HTML - Why boolean attributes do not have boolean value?

前端 未结 7 864
小蘑菇
小蘑菇 2020-12-03 10:41

I noticed that some elements have attributes which are boolean. I wonder why the values are not true or false? or 1 and 0? Are there any reason behind why they are like this

7条回答
  •  不思量自难忘°
    2020-12-03 11:16

    As vc74 has said, it doesn't matter what value you have for selected or disabled.

    will do the same as

提交回复
热议问题