if - then else




<!DOCTYPE html>
<html>
<body>

<h3>A demonstration of how to access a Checkbox</h3>

Checkbox: <input type="checkbox" id="myCheck">

<p>Click the "Try it" button to check the checkbox.</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
var x = document.getElementById("myCheck");
if ( x.checked == false) {
x.checked = true;}
else
{
x.checked = false;}
}
</script>

</body>
</html>














( ifthenelse.html )- by Paolo Puglisi - Modifica del 17/12/2023