Abdennour TOUMI
Abdennour TOUMI

Reputation: 93203

Does HTML tag name has a max size ( length )

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 ?

Upvotes: 2

Views: 1566

Answers (1)

Artyom Neustroev
Artyom Neustroev

Reputation: 8715

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.

Upvotes: 1

Related Questions