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
-1
votes
1 answer

How to do focus out handling on text box in GWT.?

I am working with a GWT project and there is scenario where I enter some data in a text box but when I click out of the text box any where on the form I have to do some other operation like show entered data as a label. How can I achieve this in…
Pratik Rawlekar
  • 327
  • 4
  • 14
-1
votes
1 answer

Toggle menu item visibility when Edittext gain and lose focus

I need to show to Toolbar menu item when EditText gains focus and hide it when EditText lose focus. I try to implement using setOnFocusChangeListener on EditText like below: edittext.setOnFocusChangeListener(new View.OnFocusChangeListener() { …
Rajesh Jadav
  • 12,801
  • 5
  • 53
  • 78
-1
votes
2 answers

Why does the background color not change in jsfiddle

I found this code from w3schools. There it works but when I run it in jsfiddle there is an issue. function myFunction(x) { x.style.background = "yellow"; } Here is the code in jsfiddle:
sotirios
  • 165
  • 1
  • 2
  • 17
-1
votes
1 answer

jBox.js tooltip show on textbox focused and hide on unfucused

When I clicked in text box jbox.js tooltip is showing, I want when text box is focused tooltip show and when unfocused tooltip hide. Script: