具有boolean值的属性:
<!--只写属性不写属性值代表属性为true-->
<input type="checkbox" checked>
<!--不写属性代表属性为false-->
<input type="checkbox">
<!--属性值=属性名,代表属性为true-->
<input type="checkbox" checked="checked">
<!--属性值=空字符串,代表属性为true-->
<input type="checkbox" checked="">
省略引号:
指定属性值的时候,属性值两边既可以用双引号,也可以用单引号
HTML 5在此基础上做了一些改进,当属性值不包括空字符串、“<”、“>”、“=”、单引号、双引号等字符时,属性值两边的引号可以省略
<!--请注意type的属性值两边的引号-->
<input type="text">
<input type='text'>
<input type=text>
html5向下兼容。容许缺少引号的错误,比之前更要求松散了。