What is boton en html cambiar texto in HTML

<!DOCTYPE html>
<html>
<head>
</head>

<body>

<button type="button" id="botonOn" onclick="FbotonOn()"> on </button>

</body>
</html>

<script>
var valor = true
function FbotonOn() {
var uno = document.getElementById('botonOn');
valor?uno.innerText = "off":uno.innerText = "on";
valor=!valor
}

</script>

Leave a Comment