<button id="btn_register" type="submit" style="width: 325px; height: 45px;background:#398bd7;border: none;">
<font style="font-size: 20px;color: #fff;">立即注册</font>
</button>
我是小白啦
$('#btn_register').click(function(){
if($.trim($('username').val()) == ''){
alert('请输入用户名')
}
})
<button id="btn_register">
<font>立即注册</font>
</button>
点了注册始终没弹窗。。谢谢各位大神
立即注册
给立即注册这个button标签,增加一个id属性,id="btn_register"
或者你干脆botton的onclick的事件中添加一个函数调用就行了
$("button").on("click",function(){
//这里写要执行的语句
})