简体   繁体   English

使用JavaScript检查HTML文档中的活动元素

[英]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? 如何从JavaScript小书签中获取活动元素(聚焦文本框或富文本框)? I want to change the text of a focussed textbox or rich text box when someone clicked on my bookmarklet. 当有人单击我的书签时,我想更改聚焦文本框或富文本框的文本。 Is it possible? 可能吗?

只需访问document.activeElement在Firefox 3.6,IE 7,Chrome 6和Safari 4中使用。未经任何其他测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用id从javascript访问HTML元素,该html元素属于另一个html文档 - how do I access a HTML element from javascript using id,the html element belongs to another html document 活动标签上的html中的搜索元素(javascript) - Search element in html on the active tab (javascript) 如何在Javascript中获取HTML页面的活动元素 - How to get the active element of a HTML page in Javascript 使用Javascript检查给定HTML元素中是否存在子元素 - Check for the existence of sub elements within a given HTML element using Javascript javascript检查文档中元素以应用值 - javascript check document for element to apply a value 如何在文档的特定位置使用纯JavaScript添加HTML文档中的元素 - How to add an element in a HTML document using pure javascript at particular position of the document Photoshop Javascript-检查文件是否打开(然后切换到活动文档),如果没有打开,请打开 - Photoshop Javascript - check to see if file is open (then switch to active document), if not, open 稍后通过JavaScript访问文档中的HTML元素 - Access HTML element later in document through JavaScript 使用javascript选择HTML文档 - HTML document selection using javascript 使用javascript检查Applet在Chrome中是否处于活动状态 - Check if Applet is Active in chrome using javascript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM