Does HTML tag name has a max size ( length )

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-06 14:54:44

问题


i do want to build a validator for HTML tagname ,

   vdAPI.get({module:'html',subject:'tag'}).validator=function (tag){
         return !vdAPI.nottags.contains(tag) && (tag.length>0 && tag.length <= vdAPI.MAX_LENGTH_TAG)
    }

What is the suitable value of vdAPI.MAX_LENGTH_TAG ?


回答1:


From the w3.org:

The algorithm described below places no limit on the depth of the DOM tree generated, or on the length of tag names, attribute names, attribute values, Text nodes, etc. While implementors are encouraged to avoid arbitrary limits, it is recognized that practical concerns will likely force user agents to impose nesting depth constraints.



来源:https://stackoverflow.com/questions/28607977/does-html-tag-name-has-a-max-size-length

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