Knockout.js data-bind attribute causes html valida

2019-09-18 01:41发布

I'm using the HTML Validator firefox add-on and when I go to the home page of http://knockoutjs.com/, I get warnings about the data-bind attribute (for the Live Example):

Examples:

<select> proprietary attribute "data-bind"

<button> proprietary attribute "data-bind"

I also get errors regarding the data-bind attribute when submitting the URL at http://validator.w3.org/.

I know this html attribute is used by knockout.js to do some data binding, but can we conclude that this approach does not follow the HTML specification? Does knockout.js follow the spirit of valid HTML markup?

1条回答
smile是对你的礼貌
2楼-- · 2019-09-18 02:17

They are HTML 5 custom attributes. Try to validate against HTML 5 specs and you should get an ok on the validation.

But since long you have been able to use custom attributes as you see fit although it may have violated strict HTML 4 specs.

查看更多
登录 后发表回答