Snap Builder Public Codes Library
Snap | Generators | Login | Browse | Search | Enter Code | Export Snap Builder Public Codes Library

 

Category: Javascript Codes Library >> Miscellaneous Snippets >> Focus onLoad


Code Snippet </> Info


Snippet Name: Focus onLoad

Description: You can put the user's cursor inside a text box (calling the text box' focus) on page load.


Compatible Browsers:
Chrome BrowserFirefox BrowserInternet Explorer BrowserOpera BrowserSafari Browser

Example: View Code Demo


Note:

Author: SnapBuilder <snippets@snapbuilder.com>

Last Modified: 2015-12-13 06:47:08

Language: html

Highlight Mode: html

Copy Codes: Use Free Notepad ++
Bookmark and Share

Snap HTML Code Editor:
Paste the source code, make changes and instantly see it in live preview.
Snap HTML Code Editor


  About Copying
Copied To Clipboard!

<html> <head> <title>Form Focus - HTML Code Snippet</title> </head> <body onLoad="document.snapfocus.user.focus();"> <p>You can put the user's cursor inside a text box (calling the text box' focus) as soon as the page is loaded. This helps ensure that visitors do not 'overlook' an important form item on your site.</p> <p>In the body of your document, add the following code snippet where you want the form focus to appear:</p> <p><form name="snapfocus">Name: <input type="text" name="user" size="20"></form></p> </body> </html>


[ Snippet Options ]

 

© 2002 -  Snap Builder Public Codes Library