$('按钮').on('click',(function(){
var val=$('输入框').val()
if(val=='我爱你'){
alert('恭喜你找到男朋友')
}else{
alert('错误 错误')
}
}))
追问![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/0823dd54564e92589821fc069082d158cdbf4ec4?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
能麻烦来个这样完整的代码吗?谢谢哥了~
追答<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<input type="text" name="love" id="love" placeholder="你爱我么"/>
<button id='sub'> 提交</button>
</body>
<script>$('#sub').on('click', (function() {
var val = $('#love').val()
if(val == '我爱你') {
alert('恭喜你找到男朋友')
} else {
alert('错误 错误')
}
}))
</script>
</html>
你这5财富值 真难