Created
November 11, 2018 15:22
-
-
Save camilomontoyau/ddda494c7d28fdeb52eeaec153344ecf to your computer and use it in GitHub Desktop.
react es js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>un título</title> | |
<meta charset="UTF-8" /> | |
</head> | |
<body> | |
<div id="app"></div><!-- este es un div con el fin de que toda la interfaz gráfica sea insertada en el mismo --> | |
<script type="text/javascript"> //Aquí comienza el navegador a entender código javascript | |
const div = document.createElement("div"); //acá se crea un elemento del DOM y se guarda en la constante div | |
div.innerText = "hola soy un div"; // acá se le modifica el contenido al div | |
const app = document.getElementById('app'); //acá se hace referencia al div con id="app" con el fin de modificarlo con el simple llamado a una constante | |
app.appendChild(div); // acá le decimos al dom que div con id="app" le inyecte nuestro div personalizado que habíamos guardado en la constante div | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment