[thelist] Setting focus+

Timothy Martens timfm at hawaii.rr.com
Fri May 10 17:07:01 CDT 2002

How can I set the cursor position to the END of an input field which
already has a value? I guess I need to get the length of the value and
then place the cursor after that - just not sure how. Here's the basic
block which sets focus to the beginning of the field...

<body onload="setFocus();">
<script language="JavaScript" type="text/javascript">
function setFocus() {

<form name="myForm">
  <input name="URL" size="40" value="http://" />

Mahalo (thanks),


More information about the thelist mailing list