Welcome visitor
* Login
* Register
It is currently July 18th, 2019, 5:18 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » JavaScript



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  set focus on image onload
PostPosted: August 17th, 2009, 11:50 am 

Posts: 42
i know how to set focus to an input field but now i want to do that for an image that i use as a link. does anyone know how to do this or am i trying something that is not possible at all?

thanks.

this is the code id been using but isnt working
<body onload="document.getElementById('imgB').focus();">
<a href="home.html"><img id="imgB" src="home.bmp" /></a>


Top
 Profile  
 
  Re: set focus on image onload
PostPosted: August 17th, 2009, 12:43 pm 

Posts: 65
focus() is only for forms elements. But you can try this
<body onload="document.getElementById('imgB').focus();">
<a href="logout.html"><input type="image" id="imgB" src="exit.bmp" /></a>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » JavaScript


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron