Technology computers-hardware

How to Display Default Text in a Search Field With HTML

    • 1). Go to the Web page or file containing the HTML code for your search box. Ask your website provider if you do not know where to find it.

    • 2). Locate the <input> field that refers to your search box. Your tag may look something like this: <input type="text" name="search" />. The trailing "/" sign is optional and may not appear in your code.

    • 3). Add the following attribute inside your <input> tag, right before the "/>" or ">" sign:

      value="Text"

      Replace "Text" with your default text, retaining the quotation marks. Your final <input> tag may look something like this:

      <input type="text" name="search" value="Enter your search term" />

    • 4). Save the page.



Leave a reply