Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I configure HTML Validator to accept only certain strings for attribute values?

0
Posted

How do I configure HTML Validator to accept only certain strings for attribute values?

0

CSE HTML Validator Professional v4.0 and above can do this (but not the standard or lite editions because they lack the Configuration Editor). In this example, the “class” attribute will be checked for certain values, and a warning will be displayed if the value is not in the list. To do this, add the following code to the beginning of the attribute program for “class (124)” using the Programs tab of the Configuration Editor. Make sure that you select the Attribute program radio button and check Enable attribute program in the Programs tab. #index=getAttIndex(“class”); if ( matchCase(getAttValue($index), “classname1”, “classname2”, “classname3”)==0 ) { Message(1, $MSG_WARNING, ‘The “‘ + getAttName($index) + ‘” attribute has a questionable value.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123