<p>
<label><input id="checkbox" type="checkbox" name="rule">复选框</label>
</p>
<p><label><input id="submit" type="submit" value="提交"></label></p>
</form>
</div>
<script>
window.onload=function(){
var submitBtn = document.getElementById("submit");
submitBtn.onclick = function () {
if(!document.getElementById("checkbox").checked) {
alert("请勾选复选框!");
return false;
}
};
}
</script>