Posted by Jonathan N. Little on 02/23/06 16:04
Stefan Mueller wrote:
>>Why do the images ever need to get focus? What can the user do with a
>>focussed image?
>
>
> I need a focused image e.g. to color a ckeckbox. Here is an example
> http://nrkn.com/customCheck/
>
>
>
>>Or if you know the number of images preceeding the random rows then
>>document.images[n].focus() where n is the number of preceeding images.
>
>
> Cool, with
> document.images[0].focus()
> I can set the focus to the first image. Is there also a similar command to
> set the focus to the first input box?
<script type="text/javascript">
function gotoFirst(){
var inputs=document.getElementsByTagName("input");
if(inputs.length){
var theFirst=inputs[0];
theFirst.focus();
}
}
window.onload=gotoFirst;
</script>
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|