The code below filters the table upon initialization to match "Search for..." This is not useful to me.
$(document).ready(function(){
$('.table').dataTable({
"oSearch": {"sSearch": "Search for..."});
});
What I want is for "Search for..." to appear in the search box itself without initializing the search parameters on page load. When the user places focus on the search box, the string disappears and the user can start typing. Any ideas?
You can give the searchbox an value like "Search for" and use jquery to clear it with onfocus, or blur, which you prefer. To clear the value when somebody "focusses " on the box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With