Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="es">
- <head>
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
- <title>Prueba DOM</title>
- </head>
- <body>
- <p id="parrafo"> The value attribute is a DOMString that contains the current value of the text entered into the text field. You can retrieve this using the HTMLInputElement.value property in JavaScript. let theText = myTextInput.value;. </p>
- <button onclick="cambiar();">Cambiar texto</button>
- <script>
- var elementoP = document.getElementById("parrafo");
- var cambio = "<b>Hola Mundo Cruel</b>";
- var cambiar = function() {
- elementoP.innerHTML = cambio;
- return elementoP;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement