Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

boton en html cambiar texto

<!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>
Source by es.stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #boton #en #html #cambiar #texto
ADD COMMENT
Topic
Name
2+9 =