[HTML] 點擊Label來勾選checkBox

  • 8300
  • 0
  • 2016-12-26

[HTML] 點擊Label來勾選checkBox

原始碼:

<!DOCTYPE html>
<html>
    <body>
        <form action="form_action.asp">
            <label for="beforeCheckBox">beforeCheckBox</label>
            <input id="beforeCheckBox" name="beforeCheckBox" type="checkbox" />
            <br/>
            <input id="afterCheckBox" type="checkbox" />
            <label for="afterCheckBox">afterCheckBox</label>
            <br/>
<label><input type="checkbox" name="inLabel">inLabel</label>
        </form>
        <p>Click the "Submit" button and the input will be sent to a page on the server called "form_action.asp".</p>
    </body>
</html>

 

以下是使用w3school來測試的執行畫面

Image(10)

Image(11)