El código no funciona. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

El código no funciona.

Al querer cambiar el valor de la etiqueta no funciona, aquí está el código: <!DOCTYPE html> <html> <head> <script> document.getElementById('valores').value="corazon"; </script> <title>Page Title</title> </head> <body> <h1 id="valores"></h1> </body> </html>

19th Jan 2020, 7:31 AM
Enrique Flores
Enrique Flores - avatar
1 Answer
0
1)Скрипт должен быть после <h1>. 2)value надо заменить на innerHTML.
19th Jan 2020, 11:04 AM
Alexander Lebedev
Alexander Lebedev - avatar