[jQuery] Clear Input Search Box?
I am trying to clear an input search box's value.
When the page loads the value is set. I.e.:
<input id="searchBox" name="searchBox" type="text" class="input"
style="width: 100px;" value="Search term or part #">
I want to set it to blank when the user clicks the box to enter a
value:
$("#searchBox").click(function() {
$("#searchBox").attr("value","");
});
I have tried a couple things but I keep getting errors..
$("#searchBox").click(function() {
$(this).attr("value","");
});