What is the difference between readonly=“true” & readonly=“readonly”?

后端 未结 6 1069
攒了一身酷
攒了一身酷 2020-11-29 03:04

What is the difference between:


and:

<         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 03:39

    readonly="readonly" is xhtml syntax. In xhtml boolean attributes are written this way. In xhtml 'attribute minimization' () isn't allowed, so this is the valid way to include boolean attributes in xhtml. See this page for more.information.

    If your document type is xhtml transitional or strict and you want to validate it, use readonly="readonly otherwise readonly is sufficient.

提交回复
热议问题