Search: Add placeholder text when search bar opens

Example:

Add "Type here to search" when the search bar expands:

How to:

Always make a duplicate of your theme before adding any code. This will save you if anything goes wrong or if you decide not to use the added code in the future. We can not support or be responsible of any code changes that you make to your theme. For that reason, save yourself and make a duplicate first.

Make a duplicate before any code changes:

Code to add:

/* -- code to add placeholder text in expanded search bar -- */
$(document).ready(function() {
    $("input.search-bar").attr("placeholder", "Type here to search"); 
});
/* - end - */

Where do I add the Javascript code?

Use this link to learn where exactly to add this code snippet:

Where to add your Javascript code

Still need help? Contact Us Contact Us