Tom Knowlton
asked on
Cannot get inner text of input tag
The alert box appears, but is empty. I want it to show the contents of the input tag with name="search".
$('input[value="go"]').cli ck(functio n ()
{
//$('input[class="searchbo x"]').css( "border", "3px solid yellow");
alert($('input[class="sear chbox"]'). text());
//document.location.href = "/search.aspx?search=" + $('input[class="searchbox" ]').html;
});
here is the markup:
<div class="utenn_search" id="utbk_searcAh">
<label for="search">search: </label>
<input type="text" name="search" class="searchbox" value="Search" onfocus="this.value=''" title="search">
<input name="go" class="submit" type="button" value="go">
</div>
$('input[value="go"]').cli
{
//$('input[class="searchbo
alert($('input[class="sear
//document.location.href = "/search.aspx?search=" + $('input[class="searchbox"
});
here is the markup:
<div class="utenn_search" id="utbk_searcAh">
<label for="search">search: </label>
<input type="text" name="search" class="searchbox" value="Search" onfocus="this.value=''" title="search">
<input name="go" class="submit" type="button" value="go">
</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thx, that was it.
or :
alert($('.searchbox').val(