提交功能对我不起作用,我所收到的是没有提醒,请帮助,谢谢。
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div style="background-color:#e7e7e7;width:220px;padding:25px;">
<strong style="font-size:15px;">Do you have a coupon?</strong>
<p style="line-height:15.5px;margin-top:2px;text-align:justify;">If you have a coupon to upgrade to Premium membership, enter the coupon code below and click upgrade.</p>
<form id="redeem_coupon" action="javascript:void();" method="post">
<input type="text" name="coupon_code" style="border:1px solid #828282;font-size:15px;width:215px;" />
<input type="submit" value="Upgrade" class="button-input" style="margin-left:0;margin-top:5px;"/>
</form>
</div>
<script type="text/javascript">
$('#redeem_coupon').submit(function() {
alert('hi');
return false;
}
</script>
答案 0 :(得分:7)
关闭括号。
$('#redeem_coupon').submit(function() {
alert('hi');
return false;
});