View Full Version : Set focus on a html button when page loads
Can anyone help out , on how to make a button [as, input type="button"] default selected/focussed , in a page.
The idea behind this is that I want to use 'enter' to fire the button's click event
Any help , highly appreciated.
01-09-2009, 03:22 AM
You can use the tabindex attribute to set focus on your button, or any other element in your page. This website (http://www.htmldog.com/guides/htmladvanced/links/) has a discussion on the subject.
Hope it helps.
01-09-2009, 07:22 AM
what do you mean of focus on a html button??
Great thing to know about seo test (http://pinayspeak.com/pinaytest/).
01-09-2009, 01:24 PM
Sorry, I didn't explain myself very well. If you set focus on the button the way I described, then hitting the Enter key will work the same as if you clicked on the button.
01-13-2009, 10:42 AM
I think you should have to learn from w3school.com for sort out your problem...its really useful for you...go ahead good luck
vBulletin® v3.0.1, Copyright ©2000-2013, Jelsoft Enterprises Ltd.