Open In App
Related Articles

HTML DOM blur() Method

Improve Article
Save Article
Like Article

The DOM blur method is used to remove the keyboard focus from the current element and also give focus with the help of the focus() method. We can apply the blur to any element and enable it by doing some operations. For example, we can blur to text-box by clicking a button. 



Example: In this example, we will use the HTML DOM blur() method.


    <title>HTML DOM blur() Method</title>
<body style="text-align: center;">
    <h1 style="color:green;">
        DOM blur Property
    <input type="text" id="txt" placeholder="Enter text here">
    <button type="button" onclick="inputFocus()">Focus</button>
    <button type="button" onclick="inputBlur()">Blur</button>
        function inputFocus() {
        function inputBlur() {



Supported Browsers: The browser supported by the blur() method are listed below:

  • Google Chrome 1
  • Edge 12
  • Internet Explorer 5.5
  • Firefox 1.5
  • Opera 8
  • Safari 3

Last Updated : 15 Jun, 2023
Like Article
Save Article
Similar Reads
Related Tutorials