javascriptFind which DOM element has the focus
var focused = document.activeElement;
ctrl + c
document.activeElement returns currently focused element (docs) |
More of Javascript
- Validate email
- Round to 1 decimal
- Get selected option text of a dropdown (select) box
- Ajax post x-www-form-urlencoded data
- Get a timestamp
- Throw error
- Use variable as regex
- Trim a string (remove beginning/ending whitespaces)
- Access object key by variable
- Insert text into textarea at cursor position
See more codes...