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

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

What is the difference between:


and:

<         


        
6条回答
  •  日久生厌
    2020-11-29 04:02

    I'm not sure how they're functionally different. My current batch of OS X browsers don't show any difference.

    I would assume they are all functionally the same due to legacy HTML attribute handling. Back in the day, any flag (Boolean) attribute need only be present, sans value, eg

    
    

    When XHTML came along, this syntax wasn't valid and values were required. Whilst the W3 specified using the attribute name as the value, I'm guessing most browser vendors decided to simply check for attribute existence.

提交回复
热议问题