So Im using something like: var searchform (.searchform) searchform.appendTo(.newposition) This correctly moves the element, however, on mobile/tablet devices (all Ive tested regardless of OS and browser) it makes it impossible to : focus in the box. Each button in question has the class"triggerBtn" and the corresponding input field has the class"inputField". Example div Email codedump link for jQuery: trigger click or focus input field. Now if the first field has the focus, clicking elsewhere or tabbing away from it displays the alert: Handler for .blur() called. To trigger the event programmaticallyRelaterede sgninger efter: jquery focus input field. The following code shows how to trigger focus event for input element. Example.Trigger focus event on a field in jQuery Turn off submit action in jQuery Update paragraph text value as you type in I have a form and need to be able to highlight/decorate fields as they gain focus (change their background color, border).jQuery script to clear input fields. 22. Managing network address information. jQuery focus / blur. Development.
You can add a class to your field when it has focus and then check for the class: