Questions tagged [onfocus]

onfocus is an event in HTML and JavaScript that triggers when the referenced object gains focus. This tag should be used only in conjunction with the primary language tag, and only for questions where the onfocus event is central to the issue(s) being addressed.

The focus event triggers when a visitor focuses on an element.

Not all elements are focusable by default. For example, INPUT and all types or form fields support this event, A supports it. As a counterexample, DIV doesn't support focus.

The list of elements types which support focusing is slightly different between browsers.

Tutorial

498 questions
-3
votes
3 answers

Make text field as a select box

When we click on a dropdown we dont see cursor, we just see the whole box with value gets selected, can we do same with text field because in text field I see the cursor blinking. see image if confused. :D
Rohit Sharma
  • 141
  • 1
  • 3
  • 10
-5
votes
2 answers

Java script on focus instead of onclick

How to change and use this function: $(function() { $("a#toggle").click(function() { $("#yellow_div").slideToggle(); return false; }); }); to run when input text get focus?
-5
votes
1 answer

Enable / disable Elements When div element gets focus

I've certain number of Input elements inside a div. When any of the input element inside the div gets focus I want disable an element outside the div? How can do this in jquery??
Emmi
  • 223
  • 1
  • 2
  • 8
1 2 3
33
34