Newer
Older
renshu-2022 / aiso / three form result.html
<!DOCTYPE html>
<html lang="ja">
<head>
<title>記録</title>
</head>
 
<body>
<h1>記録は</h1>
<form name="form1">
<input type="text" name="input1">分
<input type="text" name="input2">秒
<input type="text" name="input3">回
<br>
<input type="button" id="test1" value="実行">
</form>
<h2>1分当たり<p id="test2"> </p></h2><h2>回です。</h2>
<script>
const x = document.querySelector("#test1");
x.addEventListener("click",func1);

function func1() {
  let m = document.form1.input1.value;
  let s = document.form1.input2.value;
  let x = document.form1.input3.value;
  const z = document.querySelector("#test2");
  z.textContent = parseInt(x)/(60*parseInt(m)+parseInt(s))*60
}

</script>
</body>
</html>