Sam
Sam

Reputation: 8693

How to bring focus to a text field when you hover over it

How do you bring focus to a text field when you hover the mouse on top of the field?

Upvotes: 0

Views: 258

Answers (2)

Fosco
Fosco

Reputation: 38516

without jquery..

<input type=text   ....   onMouseOver="this.focus();">

Upvotes: 4

Delan Azabani
Delan Azabani

Reputation: 81384

myInputField.addEventListener('mouseover', function(e) {
    e.target.focus();
}, false);

Upvotes: 2

Related Questions