Search code examples
javascripthtmlformsrefer

how to refer a textbox inside body of html page in a javascript if textbox is not part of any form?


i have coded a header file which contains a input textbox for search.this header is include in body tag of a jsp page as shown below.

<body>
<include src="header.ssi">
<form>
</form>

onclick of button i header file i am running a javascript function. i need to refer to this textbox in javascript function.


Solution

  • document.getElementById — but it should be in a form