Professional Documents
Culture Documents
Js Introduction: Javascript Can Change HTML Content
Js Introduction: Javascript Can Change HTML Content
JS Introduction
JavaScript Can Change HTML Content
JavaScript accepts both double and single quotes:
document.getElementById("demo").innerHTML = "Hello JavaScript";
document.getElementById('demo').innerHTML = 'Hello JavaScript';
JavaScript in <body>
External JavaScript
External References
uses a full URL to link to a script:
Using document.write()
Using document.write() after an HTML document is loaded, will delete all existing HTML:
JavaScript Print
4. JavaScript Statements
Semicolons ;
JavaScript Literals
JavaScript Variables