复制代码代码如下:
<!doctype html>
<html lang =“ en”>
<头>
<meta charset =“ utf-8”>
<title>文档</title>
</head>
<身体>
<输入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('click',function(){
如果(flag){
flag = false;
}别的{
返回;
}
$(“#show”)。html('<p>'+$(“#msg”)。val()+'</p>');
});
}))
</script>
</body>
</html>
太容易了!