事件监听

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style>
            #d{
                width: 100px;
                height: 30px;
                background-color:slateblue;
                border:0;
                /* border-radius: 30px; */
                font-size: 9px;
                color: #F0F8FF;
            }
            #d:hover{
                background-color: burlywood;
                color: aliceblue;
                font-size: 13px;
            }
            #d2{
                width: 100px;
                height: 30px;
            
            }
        
        </style>
    </head>
    <body>
        <form id = "fr" action="http://www.baidu.com/s?wd=">
            
            <input type="text" id = "d2" />
            <input id="d" type="submit" value="提交" />
            
        </form>
    
        <script>
            function dim(){
                alert("被点击了");
            }
        
        </script>
        
    </body>
</html>

您可能还喜欢...