Difference between revisions of "Active Element Favlet"

From Level Access Web Labs
Jump to navigation Jump to search
Line 5: Line 5:
 
</html>
 
</html>
  
 +
Sample code:
 +
<code>
 +
javascript:(function() { alert(document.activeElement.outerHTML);})();
 +
</code>
 
[[Category: Favlet]]
 
[[Category: Favlet]]

Revision as of 02:22, 5 February 2014

Sometimes there is no visible keyboard focus on an element and you want to know what element has keyboard focus. This Favlet will display the outer HTML code of the active element. If frames are used this will show the current frame -- the Favlet could be updated to drill down through the frames to the active element of the current frame.

Display the active element's outer HTML code

Sample code: javascript:(function() { alert(document.activeElement.outerHTML);})();