「JavaScript入門」*=演算子のサンプル
書式
document.getElementById(“セレクタ名").innerHTML =変数名
使用例
<!DOCTYPE html>
<html>
<body>
<h2>*=演算子のサンプル</h2>
<p id="sample"></p>
<script>
var n = 15;
n*=6;
document.getElementById("sample").innerHTML = n;
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h2>*=演算子のサンプル</h2>
<p id="sample"></p>
<script>
var n = 15;
n*=6;
document.getElementById("sample").innerHTML = n;
</script>
</body>
</html>
<!DOCTYPE html> <html> <body> <h2>*=演算子のサンプル</h2> <p id="sample"></p> <script> var n = 15; n*=6; document.getElementById("sample").innerHTML = n; </script> </body> </html>