Toggling getElementById...

Which is Your Next Car?




Loading "car.js" from <script></script> in <head> of the document

syntax
<script type="text/javascript" src="car.js"></script>

The Script Code

function showcar()
{
	var myCar = "Brezza";
		document.getElementById('thecar').innerHTML=myCar;
	var isSmooth = "WOW! This is Awesome!"
		document.getElementById('amazeme').innerHTML=isSmooth;
	var hdr = "It is Definitely";
		document.getElementById('wow').innerHTML=hdr;

}
            

The HTML Code

<!DOCTYPE html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width" />

  <title>My Next Car</title>
<script src="car.js"></script> <style> /*--some style in here--*/ </style> </head> <body><h1 id="wow">Which is Your Next Car?</h1>
<p id="thecar"></p>
<button type="button" onClick="showcar()"> <span id="amazeme">Find Out</span> </button> </body> </html>