HTML DOM blur() Method
Complete Text Object Reference
Definition and Usage
The blur() method is used to remove focus from a text field.
Syntax
Example
The following example sets and removes focus from a text field:
<html>
<head>
<script type="text/javascript">
function setFocus()
{
document.getElementById('text1').focus()
}
function loseFocus()
{
document.getElementById('text1').blur()
}
</script>
</head>
<body>
<form>
<input type="text" id="text1" />
<br />
<input type="button" onclick="setFocus()" value="Set focus" />
<input type="button" onclick="loseFocus()" value="Lose focus" />
</form>
</body>
</html>
|
Try-It-Yourself Demos
Set
and remove focus from a text field
Complete Text Object Reference
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|