document.activeElement
, it’s been supported in IE for a long time and the latest versions of FF and chrome support it also. If nothing has focus, it returns the document.body
object.
More Related Contents:
- jQuery AJAX submit form
- Uploading both data and files in one form using Ajax?
- Stop form refreshing page on submit
- Clearing using jQuery
- How to set file input value when dropping file on page? [duplicate]
- Prevent double submission of forms in jQuery
- Submitting a form on ‘Enter’ with jQuery?
- How to send a JSON object using html form data
- How to submit an HTML form without redirection
- Prevent form redirect OR refresh on submit?
- Check if option is selected with jQuery, if not select a default
- How to get the containing form of an input?
- Adding POST parameters before submit
- How do I use jQuery’s form.serialize but exclude empty fields
- Dynamically create and submit form
- jQuery – select all text from a textarea
- How can I get jQuery .val() AFTER keypress event?
- Submit form after calling e.preventDefault()
- How to prevent form element from sending some fields we don’t want?
- Javascript – Stop form submit depending on ajax response [duplicate]
- How do you limit options selected in a html select box?
- submit event does not fire if submit initiated programmatically
- How to scroll to an element in jQuery?
- Twitter bootstrap – Focus on textarea inside a modal on click
- Dynamically expand height of input type “text” based on number of characters typed into field
- Is there an “after submit” jQuery option?
- Is there a better jQuery solution to this.form.submit();?
- jQuery asynchronous function call, no AJAX request
- copying the value of a form’s file input field to another form’s input field
- Form Validation With Bootstrap (jQuery)