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
Writing into an HTML element, using-------- innerHTML. | |
Writing into the HTML output using------- document.write(). | |
Writing into an alert box, using-------- window.alert(). | |
Writing into the browser console, using------ console.log(). | |
<!---- Object ----> | |
<p id="demo"></p> | |
const person = {firstName:"Alex", lastName:"Walker", age:"24", contact:"9658754856", country:"Norway"}; | |
document.getElementById("demo").innerHTML = person.firstName + " " + person.lastName + " is " + person.age; |