This SharePoint search tutorial explains how to customize the search box web part properties in SharePoint Online/2016/2013. We will also see how to set the search box for a particular search result web part in SharePoint.
In SharePoint, when the user will type in the search box then the result will populate in the search result web part. We will also see how to change the text of the Search box web part. By default in the search box web part, it is coming “search”, how we will change to “Search here” in the search box web part.
SharePoint Online search box web part
The Search box web part displays a text box where the user can enter their queries for the information in SharePoint Online.
Add “Search Box” web part to web SharePoint part page
Now we will see how to add a Search box web part in a SharePoint web part page in SharePoint Online or SharePoint 2013/2016.
Open SharePoint web part page and click on Edit the web part page. Click on Add a web part and choose Search Box from Search web part categories.

Configure Search Box web part
Go to the “Site Settings” -> Edit page. Go to the “Edit Web part” of particular web part.
Expand “Which search result page should queries to be send to?”.
Below the “Use this site’s Search Settings” we will see all the search results web part name which is present

When we search in the search box then the result is displaying in the Search result page. I have searched “NewXL” in the Search box web part, So “NewXL” is selected in the search result web part.

Change default text search box SharePoint Online/2013/2016
Now we will see one example of how to customize the SharePoint online search box web part. We will see how to change the “Search” text to “Search here” inside the text box. For that follow the below steps.

Step-1: First go to SharePoint online “Site Settings”

Step-2: In the “Master Page Gallery” page select on “Display Templates”.

Step-3: Select the “Search” in the “Display Templates” page.

Step-4: In the Search page search for “Control SearchBox.html” right click on it and “Download a Copy” in the local system. Remember that do not touch the js file.

Open the HTML file in your favorite editor. Then change the title, I have changed that “Demo SearchBox SharePoint” below the <head>. Then search for
if ($isNull(prompt))
{
prompt = Srch.Res.sb_Prompt;
}
in the body part of html file. then change to
if ($isNull(prompt))
{
prompt = "Search here";
}
Change the title tag value. Here I have changed to “Demo SearchBox SharePoint”.
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
<head>
<title>Demo SearchBox SharePoint</title>
<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:TemplateHidden msdt:dt="string">0</mso:TemplateHidden>
<mso:MasterPageDescription msdt:dt="string">Displays the Search Box control.</mso:MasterPageDescription>
<mso:ContentTypeId msdt:dt="string">0x0101002039C03B61C64EC4A04F5361F385106601</mso:ContentTypeId>
<mso:TargetControlType msdt:dt="string">;#SearchBox;#</mso:TargetControlType>
<mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
</mso:CustomDocumentProperties>
</xml><![endif]-->
</head>
<body>
<div id="Control_SearchBox">
<!--#_
var showQuerySuggestions = ctx.ClientControl.get_showQuerySuggestions();
var showNavigation = ctx.ClientControl.get_showNavigation();
var prompt = ctx.ClientControl.get_initialPrompt();
if ($isNull(prompt))
{
prompt ="Search Here";
}
Then Save the html file and rename it. Upload the HTML file to Display Template -> Search. Here I have uploded “SearchBox.html”. When we upload the html file then the js file will created automatically. Donot touch the js file.

Go to the Site page. Then go to edit site page. And go to particular that web part “Edit Web Part” page. Expand the “Settings”. In the “Search box control Display Template” field choose the “Demo SearchBox SharePoint(what ever we given in the html page title tag”. Click on Apply and OK.

Save the page. We can able to see the text is changed to “Search here”. Check the below screenshot.

You may like following SharePoint search tutorials:
- Content Search web part in SharePoint Online
- SharePoint Online search result web part display documents created or modified by current user
- Display SharePoint Online List Items using a Content Search web part
- SharePoint search managed properties
- Difference between classic search experience and modern search experience in SharePoint Online Office 365
- SharePoint another site or list is still using this content type
- SharePoint Online vs SharePoint on-premise
- Documents are not showing up in Search Results in SharePoint 2013
- How to Call SharePoint Search using REST API
I hope this SharePoint online “Search box” web part helpful to you. We knew how to add the Search box web part. We also knew how to send the search box value to particular search result web part. We saw how to change the “Search box” web part text box text to “Search here”.
I am Bijay a Microsoft MVP (8 times –Â My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com