El evento Onfocus es un evento que ocurre cuando el cursor cae en el cuadro de texto.
El evento Onblur es un evento que ocurre cuando el cursor pierde el enfoque.
Puedes escribir el siguiente ejemplo
1.html
<html> <fead> <title> Use el controlador de eventos Onblur </title> </head> <body bgcolor = "lavender"> <form name = "f1"> <input type = text name = text1 value = "1111onblur_green" onblur = "(document.bggColor = 'verde')"> <input type = text = name = text2 value = "2222AnblurBack" Onblur = "(document.bgcolor = 'black')"> <input type = text name = text2 value = "33333onblur_yellow" onblur = "(document.bgcolor = 'Yellow')"> <br> <p> <input type = text name = text3 value = "44444onfocus_blue" onfocus = "(document.bgcolor = 'input. Type = text name = text4 value = "55555onfocus_red" onfocus = "(document.bgcolor = 'rojo')"> <input type = text name = text4 value = "6666onfocus_orange" onfocus = "(document.bgcolor = 'naranja')"> </form> </body> </html>>
También hay ejemplos a continuación
2.html
<!-Descripción del archivo: Evento Onfocus-> <!- ------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------- <input type = "text" name = "test2" value = "No puedo apagarlo una vez que presioné, jaja" onfocus = alert ("Me convertí en el enfoque de entrada!")> </form> </body> </html>El cliché anterior habla sobre el incidente de Onblur y el incidente de Onfocus (JS) son todo el contenido que comparto con ustedes. Espero que pueda darle una referencia y espero que pueda apoyar más a Wulin.com.