• 適当にもらって練習してみる
<html><head><title>js test</title>
<script>

//alert("test1");
//console.log("Hello, world!")
//document.write("Hello World!!");

onload = function() {
	document.getElementById("btn1").onclick = function() {
		alert("btn1");
	};
	document.getElementById("btn2").onclick = function() {
		alert("btn2");
	};
};
</script>
</head><body>
<textarea type="text" id="source" rows="20" cols="80"></textarea>
<input type="button"  id="btn1" value="btn1"> 
<input type="button"  id="btn2" value="btn2"><br> 
<hr> 
<div id="result">result:<br></div> 
</body></html>