有趣的JavaScript脚本:你必须爱我

JavaScript
技之树 2021-9-11

4115 3

代码

<html>
<head>
<title>You must love me</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<h1 style="position:absolute; left:220px; top:175px; width:auto; height:210px;">Do you love me?</h1>

<div id="By" style="position:absolute; left:285px; top:235px; width:210px; height:210px;">
    <input type="button" value=" yes " onclick="f1undefined)" />
</div>

<div id="Bn" style="position:absolute; left:360px; top:235px; width:210px; height:210px;">
    <input type="button" value=" no " onmouseover="fundefined)" />
</div>

<script type="text/javascript">
    flag = 1
    function f1() {
        alert("Yes. you are right ")
    }

    function f() {
        if (flag == 1) {
            Bn.style.top = 90 Bn.style.left = 500 flag = 2
        } else if (flag == 2) {
            Bn.style.top = 90 Bn.style.left = 50 flag = 3
        } else if (flag == 3) {
            Bn.style.top = 235 Bn.style.left = 360 flag = 1
        }
    }
</script>

</body>
</html>
这家伙太懒了,什么也没留下。
最新回复 (3)
  • 金丹高手 道天钧
    0 4
    支持
    这家伙太懒了,什么也没留下。
    2021-9-19 回复
  • 炼气菜鸟 caojiale
    0 3
    支持
    这家伙太懒了,什么也没留下。
    2021-9-19 回复
  • 筑基入门 tenyet
    0 2
    支持
    这家伙太懒了,什么也没留下。
    2021-9-11 回复
    • YiOVE论坛
      5
         
返回