รูปที่ 19-20
html-basic.html
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>This is title</title>
<meta charset="utf-8">
<meta name="Keywords" content="HTML,CSS,JavaScript">
<meta name="Description" content="This is desciption">
<link type="text/css" href="style.css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="myscript.js"></script>
</head>
<body>
<h1>This is a Heading</h1>
<hr>
<p> This is a <b>paragraph</b></p>
<button id="btn-spoiler">Spoiler</button>
<div id="secret-content">
<h1>Hello Meow!!</h1>
</div>
<input type="text" id="a">
+
<input type="text" id="b">
<button id="btn-cal">=</button>
<span id="c"></span>
</body>
</html>
------------------------
myscript.js
$(function() {
$('#btn-cal').click(function(){
var a=$('#a').val();
var b=$('#b').val();
var c=a*1+b*1;
$('#c').text(c);
});