What is the purpose of for attribute in output element? [closed]

假装没事ソ 提交于 2020-01-02 08:35:43

问题


Besides adding semantics, I find the new HTML output element pretty pointless. From the specification, it says:

The for content attribute allows an explicit relationship to be made between the result of a calculation and the elements that represent the values that went into the calculation or that otherwise influenced the calculation. The for attribute, if specified, must contain a string consisting of an unordered set of unique space-separated tokens that are case-sensitive, each of which must have the value of an ID of an element in the same Document.

The calculation of the value in the output is still being done via javascript. Since the for attribute is not used in the derivation of the result, what is the purpose of specifying it?

来源:https://stackoverflow.com/questions/20700499/what-is-the-purpose-of-for-attribute-in-output-element

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!