hasAtt[ForStartTag]() (tick_24Validator Engine Only)

int hasAtt(string $att1[, string $att2...])

Returns the attribute index (1 or greater) of the first attribute with the name $attx that exists (a case-insensitive search is performed), else returns 0.

Use in tag name start, attribute, and attribute value programs to quickly determine whether attributes have been used (with or without a value).

This function has changed in v10.9924 and later; it now returns the attribute index of the first attribute found instead of always returning 1 if any attribute is found (this provides more useful information)

This function is supported by CSS HTML Validator v10.00 and later.

bool hasAttForStartTag(string $att1[, string $att2...])

Returns 1 if $att1 or any of the provided attribute names exist in the start tag (a case-insensitive search is performed), else returns 0.

Use only in tag name end programs.

May require that runProgram(21) be used in the start tag name program.

This function is supported by CSS HTML Validator v8.00 and later. In versions previous to v11.0114, this functions was hasAttStartTag() (which still works for backward compatibility).

Multiple arguments (more than one attribute name) are only supported by CSS HTML Validator v17.0212 and later.