carefree Posted December 3, 2007 Share Posted December 3, 2007 I have a search portal on my site, but i have to click the <input> box before I can search for something. <input name="search" type="text" id="search" size="60"> Is there a way to make the prompt appear in the <input> box by default?? Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 3, 2007 Share Posted December 3, 2007 <script language="javascript"> window.onload=function() { document.getElementById('search').focus(); } </script> <input name="search" type="text" id="search" size="60"> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.