javascriptFind which DOM element has the focus
var focused = document.activeElement;ctrl + cdocument.activeElementreturns currently focused element (docs) |
More of Javascript
- Validate email
- Round to 2 decimals
- Ajax post x-www-form-urlencoded data
- Get a timestamp
- Round to 1 decimal
- Get selected option text of a dropdown (select) box
- Create array with N random elements (1...N range)
- Get all children and grandchildren of an html element recursively
- How to get element position relative to window
- Insert text into textarea at cursor position
See more codes...