Chapter 8: Our First Real Script

300 5 3
                                    

We're just going to create a really basic script that anyone can write!
I will include the HTML so no confusion occurs, and it is recommended to use indents in your code.
<HTML>
<button id="newButton">This is my button</button>
<script type="text/JavaScript">
var firstNum = 3;
var secondNum = 5;
var button = document.getElementById('newButton');
button.innerHTML = firstNum + secomdNum;
</script>
</HTML>

You've reached the end of published parts.

⏰ Last updated: Nov 20, 2014 ⏰

Add this story to your Library to get notified about new parts!

JavaScript for NewbiesWhere stories live. Discover now