Displaying text in Javascript
- Create a basic html
- Set the page title
- Display static header text
- Include a Javascript file in our html
- Get a reference to an html element and change its text content.
The html page for the application. We will use a div to display text to the user. We set an id for the div so we can grab it from Javascript. And we also include our Javascript file.
That’s it. We can open our index.html file in chrome, just double click it, and we will see our hello world! message displayed on the webpage.
Sample Page:
http://javascript.kennyming.com/code/1-displaying-text/
Sample Code:
https://github.com/kennymingt/javascript/tree/master/code/1-displaying-text
Comments
Post a Comment