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 ARE READING
JavaScript for Newbies
Non-FictionThis is a step by step tutorial book on how to program in JavaScript. From beginner to Expert!