复制代码代码如下:
<! doctype html>
<html lang = "en">
<head>
<meta charset = "utf-8">
<title> เอกสาร </title>
</head>
<body>
<อินพุต type = "text" id = "msg">
<a href = "#" id = "ผลลัพธ์"> 提交 </a>
<div id = "show"> </div>
<script src = "jQuery1.11.js"> </script>
<script>
$ (function () {
var flag = true;
$ ("#result"). on ('คลิก', function () {
ถ้า (ธง) {
ธง = เท็จ;
}อื่น{
กลับ;
-
$ ("#show"). html ('<p>'+$ ("#msg"). val ()+'</p>');
-
-
</script>
</body>
</html>
ง่ายมาก!