开发者

Check active element in the HTML document using JavaScript

开发者 https://www.devze.com 2023-01-22 09:52 出处:网络
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 cli

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

精彩评论

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