<!--sample solution to index.html-->
<html>
<head>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<button onclick="sayHello('world')">Click Me</button>
<div id="result"></div>
</body>
</html>
// sample solution to script.js
function sayHello(name) {
document.getElementById("result").innerHTML = "Hello " + name + "!";
}
No comments:
Post a Comment