English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Modificar el contenido del elemento:
<body> <p id="pid">Hello</p> <button onclick="demo()">botón</button> <script> function demo(){ var nv = document.getElementById("pid"); nv.innerHTML="World"; } </script> </body>
Modificar las propiedades de los elementos del etiqueta:
<body> <a href="http://www.baidu.com/" id="aid" >jeje</a> <button onclick="demo()">botón</button> <script> function demo(){ document.getElementById("aid").href="http://www.jikexueyuan.com"; } </script> </body>
Aquí termina todo el contenido sobre cómo modificar el contenido de los elementos HTML y cambiar las propiedades utilizando funciones JS, esperamos que todos nos apoyen y alienten a la tutoriales de apoyo~