0

Help,new in java

cannot set property el textcontent of null

22nd Mar 2019, 6:32 PM
Aziz Bassim
Aziz Bassim - avatar
4 Réponses
+ 1
://Its working fine, please try by embedding javascript in same page as shown <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <div id="content"> <div id="greeting" class="message">Hallo</d> </div> </body> <script> var greeting = "Aziz "; var name = "Bassim"; var message = "Please check je order"; var welcome = greeting + name + message; var el = document.getElementById ("greeting"); el.textContent = welcome; </script> </html> //solved https://code.sololearn.com/W4KJnaInXl56/?ref=app
22nd Mar 2019, 6:52 PM
Sudarshan Rai
Sudarshan Rai - avatar
0
var greeting = "Aziz "; var name = "Bassim"; var message = "Please check je order"; var welcome = greeting + name + message; var el = document.getElementById ("greeting"); el.textContent = welcome;
22nd Mar 2019, 6:33 PM
Aziz Bassim
Aziz Bassim - avatar
0
This is my code and always receive this error. Can someone help me
22nd Mar 2019, 6:34 PM
Aziz Bassim
Aziz Bassim - avatar
0
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <div id="content"> <div id="greeting" class="message">Hallo</d> </div> </body> </html>
22nd Mar 2019, 6:34 PM
Aziz Bassim
Aziz Bassim - avatar