i have written the below jquery to remove the text “search this site”. it is working fine . but on mouse over it is still showing the old text i.e ” search this site”. Also when I now try to insert a search term I first have to blank out the initial text – it’s not automatically blanked out when selecting the search box. Do you have a fix for this? Below is my jquery function:
$(function() {
var theSearchBox = $(‘#ctl00_PlaceHolderSearchArea_SmallSearchInputBox1_csr_sbox’);
var defaultSearchText = “Search this site”;
var preferredSearchText = “Search the Homepage Content”;
//replace the text initially
theSearchBox.val(preferredSearchText);
theSearchBox.focus(function() {
if ($(this).val().indexOf(defaultSearchText) > -1)
$(this).val(preferredSearchText);
});
theSearchBox.blur(function() {
if ($(this).val().indexOf(defaultSearchText) > -1)
$(this).val(preferredSearchText);
});
});

0 commentaires:
Enregistrer un commentaire