javascriptFind which DOM element has the focus
var focused = document.activeElement;
ctrl + c
document.activeElement returns currently focused element (docs) |
More of Javascript
- Round to 1 decimal
- Get selected option text of a dropdown (select) box
- Access object key by variable
- Call function by its string name
- Convert string "true" or "false" value to boolean
- Sort array of objects by specific property
- Check if variable is a string
- Validate email
- How to return to a previous page
- Get a timestamp
See more codes...