DelphiFAQ Home Search:
General :: Programming :: JavaScript
Code snippets to add functionality to your HTML pages, preferably cross-browser.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

How to focus on an input field when the page is loaded

The object model provides a .focus() method.
Simply reference the field and call its focus method in the onload event as shown below:

<body onload="document.getElementById('searchterm').focus();">
 // .. here's the FORM. Make sure to define the ID tag,
 // not just the name tag.
 <textarea id="searchterm">

Generated 4:01:34 on Sep 27, 2020