求问:100%7是什么意思,如何计算的,
<script type="text/javascript">
var a;
a=100%7;
b=100%5;
//alert("mya的值是:"+mya);
document.write(a+"<br>"+b+"<br>");
</script>
取余哦
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <input type="button" onclick="one()" value="button1"> <input type="button" onclick="two()" value="button2"> <script> function one() { var a=100; var b=7; var c=a%b; document.write(c); } function two() { var d=100; var e=5; var f=d%e; document.write(f); } </script> </body> </html>
取余
100除以7的余数
除余。
100%7的意思是100除以7的余数