jquery obtained loses focus processing method for an input block

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <p>帐号:&ensp;<input type="text" name="" id="" value="" /></p>
        <p>密码:&ensp;<input type="text" name= "" ID = "" value = ""  /> </ P > 
    </ body > 
</ HTML > 
< Script the src = "jQuery-3.4.1.js" type = "text / JavaScript" charset = "UTF- . 8 " > </ Script > 
< Script type =" text / JavaScript " > 
    // focus () processing the obtained input box focus 
    // bulr () processing the input box loses focus 
    $ ( function () { 
        $ ( ' INPUT: First ' ).focus(function() {
            $(this).css('background', '#eee');
        });
        $('input:first').blur(function() {
            $(this).css('background', '#fff');
        });
        $('input:enabled').focus(function() {
            $(this).css('background', '#eee');
        });
        $('input:enabled').blur(function() {
            $(this).css('background', '#fff');
        });
    });
</script>

 

Guess you like

Origin www.cnblogs.com/li1234567980/p/11746985.html