在HTML中,可以使用<input>
标签的type="checkbox"
属性来创建一个可勾选框,以下是一个简单的示例:,在这个示例中,我们创建了一个包含三个可勾选框的表单,每个可勾选框都有一个对应的<label>
标签,用于描述该选项,当用户点击复选框时,选中状态会发生变化。,,<!DOCTYPE html> <html> <head> <title>可勾选框示例</title> </head> <body> <h1>可勾选框示例</h1> <form> <label for=”checkbox1″>选项1</label> <input type=”checkbox” id=”checkbox1″ name=”checkbox1″><br><br> <label for=”checkbox2″>选项2</label> <input type=”checkbox” id=”checkbox2″ name=”checkbox2″><br><br> <label for=”checkbox3″>选项3</label> <input type=”checkbox” id=”checkbox3″ name=”checkbox3″><br><br> </form> </body> </html>,
原创文章,作者:admin,如若转载,请注明出处:https://www.vaicdn.com/news/54851.html