常見的選擇贊成以後才能點擊下一步按鈕

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>須要接受協議才能夠進行下一步</title>
        <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
        <script type="text/javascript">
            $(function() {
                $("#selectMe").click(function() {
                    var obj = $("#next").get(0);
                    obj.disabled = !$("#selectMe")[0].checked;
                });
            });
        </script>
    </head>

    <body>
        <form action="index.html">
            <input type="checkbox" id="selectMe" />請接受協議
            <input type="submit" id="next" value="下一步" disabled="disabled" />
        </form>
    </body>

</html>javascript

相關文章
相關標籤/搜索