Special Code
Without Refreshing
<script>
function cal(){
var a =parseInt(document.getElementById('t5').value);
var b =parseInt(document.getElementById('t6').value);
var c = a * b;
parseInt(document.getElementById('t7').value = c);
}
var form=document.getElementById("formId");
function submitForm(event){
//Preventing page refresh
event.preventDefault();
}
//Calling a function during form submission.
form.addEventListener('submit', submitForm);
</script>
Form
<form action="#" method="post" enctype="multipart/form-data">
meta data
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
Form
<form action="" method="POST" enctype="multipart/form-data">
Random
var R = parseInt(Math.random() * txt + 1);
JS with CSS
function closeForm1() {
document.getElementById("myForm").style.display = "none";
}
Random
<body><center>
<input type="text" id="txt" name="txt" placeholder="ຈໍານວນນັກສຶກສາ" /><br><br>
<button onclick="getVal();"> ເລືອກຜູ້ໂຊກດີ </button><br><br>
<input type="text" id="txt1" name="txt" placeholder="ຜູ້ຖາມ" /><br>
<input type="text" id="txt2" name="txt" placeholder="ຜູ້ຕອບ" /><br>
<br></center>
<script>
document.getElementById('txt').Value="";
function getVal(){
var txt = parseInt(document.getElementById('txt').value);
var R = parseInt(Math.random() * txt + 1);
var R2 = parseInt(Math.random() * txt + 1);
//alert(R);
document.getElementById('txt1').value = R;
document.getElementById('txt2').value = R2;
}
</script>
<script async src="https://drv.tw/inc/wd.js"></script>
</body>
Other