PDA

View Full Version : Set focus on a html button when page loads


Yua
01-08-2009, 05:53 PM
Hi,

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.

Yua

vinyl-junkie
01-09-2009, 02: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.

jams002
01-09-2009, 06:22 AM
what do you mean of focus on a html button??





___________________
Great thing to know about seo test (http://pinayspeak.com/pinaytest/).

vinyl-junkie
01-09-2009, 12: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.

maigan
01-13-2009, 09: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