开发者

Check active element in the HTML document using JavaScript

How can I get the active element(focussed textbox or rich text box) from a JavaScript bookmarklet? I开发者_StackOverflow want to change the text of a focussed textbox or rich text box when someone clicked on my bookmarklet. Is it possible?


Just accessing document.activeElement works in Firefox 3.6, IE 7, Chrome 6 and Safari 4. Untested in anything else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜