Home > Web Front-end > JS Tutorial > body text

How to remove focus in javascript

醉折花枝作酒筹
Release: 2022-04-02 13:39:39
Original
2810 people have browsed it

Javascript method to remove focus: 1. Use the onblurs attribute, the syntax "onblur="js code that needs to be executed"; 2. Use the blur() function, the syntax "$(selector).blur(function );".

How to remove focus in javascript

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

javascript focus removal

1. Use the onblurs attribute

The onblur attribute is triggered when the element loses focus.

Syntax

onblur="SomeJavaScriptCode"
Copy after login

HTML tags that support this event attribute:

, ,

, , , < ;bdo>, ,
,