12,162
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>jsbasicversion8</title>
<script>
function saySomething(obj) {
switch(obj.id) {
case "trump":
alert("Four score and seven years ago..."); break;
case "Kenidy":
alert("Ask not what your country can do for you..."); break;
case "clinton":
alert("I am not a crook!"); break;
default: }
}
</script>
</head>
<body>
<h2>
THE FAMOUS PRESIDENT QUOTES
</h2>
<input type="button" value="kenidy" id="kenidy" onclick= "saySomething(this);"/>
<input type="button" value="clinton" id="clinton" onclick="saySomething(this);"/>
<input type="button" value="trump" id="trump" onclick="saySomething(this);"/>
</body>
</html>