HTML5 APPLICATIONS DEVELOPMENT MANUAL

(lu) #1

We can connect JavaScript to HTML documents in a couple of ways:



  • Embedding it with the

  • Linking a separate JavaScript file to the HTML document


External file: myScript.js


function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
<!DOCTYPE html>









Free download pdf