Html 类型值无效

标签 html checkbox types

我正在处理一段 html,代码给了我一个“元素输入上的属性类型的错误值复选框”。这是引发错误的代码行

    <input type="checkbox" id="show-menu" role="button">
    <label for="show-menu" class="show-menu">Show Menu</label>

任何帮助将不胜感激!

最佳答案

删除角色属性

<input type="checkbox" id="show-menu" name="yourname"  checked>

使用其中任何一个

<input name="name" id="id" type="checkbox" checked>
<input name="name" id="id" type="checkbox" checked="">
<input name="name" id="id" type="checkbox" checked="yes">
<input name="name" id="id" type="checkbox" checked="blue">
<input name="name" id="id" type="checkbox" checked="false">

检查this回答更多

关于Html 类型值无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28622613/

相关文章:

javascript - Electron 上的 "Never ask again"功能dialog.showMessageBox 方法

c - 关于 `size_t`和它们测量的指针类型

arrays - string 与 []byte 类型定义

node.js - puppeteer 类型 node_modules/puppeteer/lib/types "' has no exported member ' Cookie'

javascript - 调整 <canvas> 元素的大小

javascript - 如何在html中做出绑定(bind)效果

java - 获取 ListView 中所有复选框的列表

html - 如何使用文本溢出:ellipsis in full height of div

html - 如何将图像定位到负右位置并防止水平滚动条

php - 使用复选框来过滤记录 PHP MySQL