Sorry to ask a very simple question. I do not know a keyword to search.
I have a drop-down list. I want to use if-statement to check whether this list is being focused. Is there any method to check if an element is being focused?
I guess that it will be named like...
element.onFocus()
or...
Ummm.. I may need some time to try the way you suggest. I am so new to javascript (about 6 days) so I do not know anything much. DOM is one thing I need to study more.
Anyway, thank you very much for your suggestion. I guess that it will definitely work, if I can use it in a right way. ^^
Thank you BillyRayPreachersSon.
But I found out that removing () out of the statement caused my function unable to work.
mySelect.onchange = moveFocus;
I'm still confused because as I have seen in other websites, your solution works well. But I use greasemonkey for Firefox to write my own...
Can anyone please kindly answer my javascript question?
I write a script that uses a library to add new shortcuts to a web page.
One shortcut's function is, when pressed, a drop-down list will be added to a page.
Inside that drop-down list, there are lists of location within that page to jump...
Normally, I can set focus on a link element ( <a heref="..." ) by just getting that element by ID and then use focus().
However, I have to set focus on an element that is not a link. It has a structure as followed..
<span class="mw-headline">History</span>
Can anybody please suggest me a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.