blur() Method
<head>
<style>
a:focus, a:active {
color: green;
}
</style>
</head>
<body>
<a id="myAnchor" href="https://www.w3schools.com">Visit W3Schools.com</a>
<input type="button" onclick="getfocus()" value="Get focus">
<input type="button" onclick="losefocus()" value="Lose focus">
<script>
function getfocus() {
document.getElementById("myAnchor").focus();
}
function losefocus() {
document.getElementById("myAnchor").blur();
}
</script>
</body>
Also in HTML:
- favicon
- how to resize submit button in html
- html input regex
- html title attribute css
- linking external pages html
- html timer
- how do you play audio files on html
- html5 number integer
- datatable pdfHtml5 pagesize
- minimum width of different devices in html
- html form checkbox
- how to gather true or false value from html checkbox in javascript
- html basics
- how to start using jQuery CDN
- dl tag html
- set default value of a multiselect in html
- iframe
- html starter
- filter grepl r
- html video loop
- html input
- how to write superscript in html
- comment a div in html
- html svg