Hi @Bette,
Q1 & 2
Question 3ā¦
Yesā¦but not as HTML-formatted content. The console.log
function always prints to the console (not the web page document) and so:
console.log("<h1>I'm the main title<h1>");
/* => <h1>I'm the main title</h1> logged to the console (the HTML tags
are not interpreted as anything different than as part of the string. */
document.write("<h1>I'm the main title<h1>");
/* I'm the main title displayed as a formatted title on the web page
(marked up with HTML h1 element tags */
Question 4ā¦
⦠and we can change the contents of an HTML page by writing JavaScript code which accesses and manipulates the pageās Document Object Model (DOM).