html
1 <div onclick="test()" id="fade" style="position: relative; top:0px; left:0px; width:100%; height:100%; background-color:#000000;"> 2 <div id="box" style="position: absolute; text-aling:center; top:13%; left:31%; height:75%; width:40%; border: 3px solid white; background-color:white; border-radius: 35px;"></div> 3</div>
javascript
1<script type="text/javascript"> 2 function test(){ 3 document.getElementById("fade").style.display="none"; 4 document.getElementById("box").style.display="none"; 5 } 6</script>
今はid="box"をクリックしてもonclickが反応してしまいます。
id="fade"だけonclickが効くようにしたいです。
お願いします。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/07/11 09:22
退会済みユーザー
2016/07/11 21:17