04赋值运算符2020.3.9

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>


    <h2 id ="res">  </h2>
      <script>
          //把十赋给a
var a =10;
    a+=10;//<===>a=a+10
    a-=10;//<===>a=a-10
    a*=10;//<===>a=a*10
    a/=10;//<===>a=a/10
    a%=10;//<===>a=a%10
    


document.getElementById ("res").innerHTML= a ;







      </script> 
</body>
</html>
发布了40 篇原创文章 · 获赞 3 · 访问量 494

猜你喜欢

转载自blog.csdn.net/weixin_43079958/article/details/105088511