Comment tester si un input a le focus ?

Comment tester si un input a le focus ? - HTML/CSS - Programmation

Marsh Posté le 06-02-2003 à 14:33:35    

Salut !
 
Existe-t-il en javascript un fonction qui permet de tester si un input à le focus ?
 
Merci

Reply

Marsh Posté le 06-02-2003 à 14:33:35   

Reply

Marsh Posté le 06-02-2003 à 18:51:09    

pourquoi tu ne déclanches pas ton event avec un onFocus ??

Reply

Marsh Posté le 06-02-2003 à 19:00:25    

There is nothing inbuilt that will provide this information for you. What you could do is monitor this yourself by declaring a variable which holds the information of the element that has the focus, and then monitoring it using onFocus() and onBlur() event handlers to keep the variable updated.  
 
All form elements except hidden support onFocus(), however on UNIX, Netscape 2 and 3 only support onFocus() for text entry type fields, i.e. text,textarea and fileupload.  
 
Source : http://developer.irt.org/script/135.htm

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed