复制代码代码如下:
<!doctype html>
<html lang = "en">
<head>
<メタcharset = "utf-8">
<title> document </title>
</head>
<body>
<入力型= "text" id = "msg">
<a href = "#" id = "result">提交</a>
<div id = "show"> </div>
<スクリプトsrc = "jquery1.11.js"> </script>
<スクリプト>
$(function(){
var flag = true;
$( "#result")。on( 'click'、function(){
if(flag){
flag = false;
}それ以外{
戻る;
}
$( "#show")。html( '<p>'+$( "#msg")。val()+'</p>');
});
})
</script>
</body>
</html>
とても簡単です!