<input onblur="myFunction()"> - Javascript DOM Event

Javascript examples for DOM Event:onblur

Introduction

The onblur event occurs when an object loses focus.

Summary

Bubbles No
Cancelable No
Supported HTML tags: ALL HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="text" onblur="myFunction()">

<script>
function myFunction() {/*from   w w w. j a  v  a2  s  . co  m*/
    console.log("Input field lost focus.");
}
</script>

</body>
</html>

Related Tutorials