JavaScript
	NOT Java
<script>
//inside the script, comments are different
/* multi-line
Comment */
</script>
<!—html comments -->

Include *.js

Button
	Start action
	Action can be calling javascript
Also, can run javascript on load
Body can prompt action on load

Javascript runs on browser’s server
(next semester: PHP which runs on server)
(AJAX)

Javascript can look at and change HTML content

Javascript can get information:
	By looking at named parts of HTML code
	By having a parameter passed
	By getting information from a FORM

<html>
<head>
<title> javascript </title>
<script>
function test0()
	{
	alert("Hello world!");
	}
</script>
</head>
<body>
<p id = "fred">0</p>
<p id = "button1">
<button onclick="test0()">CLICK ME</button>
</p>
</body>
</html>
<html>

<head>
<title> javascript </title>
<script>
function UP()
	{
	let newText1 = document.getElementById("fred").innerHTML;
	newText1 = 1.0 * newText1 + 1.0;
	document.getElementById("fred").innerHTML = newText1;
	}
function DOWN()
	{
	let newText1 = document.getElementById("fred").innerHTML;
	newText1 = 1.0 * newText1 - 1.0;
	document.getElementById("fred").innerHTML = newText1;
	}
</script>
</head>
<body>
<p id = "fred">0</p>
<p id = "button1">
<button onclick="UP()">ADD</button>
<button onclick="DOWN()">SUB</button>
</p>
</body>
</html>

<html>
<head>
<title> javascript </title>
<script>

function convertCF()
	{
	//let newText1 = document.getElementById("barney").innerHTML;
	let newText1 = document.getElementById("barney").value;//use value because in form
	//newText2 = newText1 * (9.0 / 5.0) + 32.0;
	let newText2 = (1.0 * newText1) * (9.0 / 5.0) + 32.0;
	//use let
	//make sure it knows using decimals, not integers
	document.getElementById("fred").innerHTML = newText2;
	}

</script>
</head>
<body>
<p id = "button3">
<button onclick="convertCF()">convert C to F</button>
</p>
<form action = "" method = "">
<input type = "number" id="barney" value = 0><br/>
</form>
RESULT:
<p id = "fred">0</p>
</body>
</html>