checkbox下面的提示框 鼠標移入時顯示,移出時隱藏


 
         
<html>
<head>
<title>shu</title>
    <style>#div1{width:200px;height:200px;border:1px solid red;background:grey;display:none;}</style>
    <script>
        function show(){
        var a=document.getElementById("div1");
        a.style.display='block';
        }
        function over(){
        var a=document.getElementById("div1");
        a.style.display='none';
        }
    </script>
</head>
<body>
    <input type="checkbox" onmouseover="show();" onmouseout="over();"/>
        <div id="div1">
        為了您的信息安全
        </div>
</body>
</html>
 
         

 



鼠標移入到input上的時候,讓div1顯示
鼠標移出input的時候,讓div1隱藏

div1顯示:
div1的display變成block

------------------------------------------------------------------------------------------------------------------------


事件:用戶操作

on click

------------------------------------------------------------------------------------------------------------------------

div1.style.display='block';

. 的

div1的style的display

 

 
         
<html>
<head>
<title>shu</title>
    <script>
        function show(){
        var i=document.getElementById("tishi");
        i.click=alert("您確定嗎?");
        }
    </script>
</head>
<body>
    <div id="div1">
        點擊確認進入下一步操作:
    </div>
    <button id="tishi" onclick="show();">確定</button>
</body>
</html>
 
         

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM