HTML Tags Checker can be integrated into your website or application in several ways. This guide covers embedding options, URL parameters, and using the public API.
Create direct links with pre-filled tag values using URL parameters:
<!-- Check if div can contain p --><a href="https://your-domain.com/index.html?parent=div&child=p&lang=en"> Can div contain p?</a><!-- Check if p can contain div --><a href="https://your-domain.com/index.html?parent=p&child=div&lang=en"> Can p contain div?</a>
The tool will automatically validate and display results when opened with these parameters.
Validates whether a parent tag can contain a child tag according to W3C HTML5 standards.
const validation = canContain('div', 'p');console.log(validation);// Output:// {// valid: true,// message: "The <div> tag is a block element and can contain block or inline elements like <p>.",// warning: false// }
Parameters:
parentTag (string): The parent HTML tag name (without brackets)
childTag (string): The child HTML tag name (without brackets)
Returns:
valid (boolean): Whether the nesting is valid
message (string): Detailed explanation in the current language
warning (boolean): Whether this is a warning case (allowed but potentially problematic)