YogeshChauhan . com

What is HTMLUnknownElement?

in HTML & JavaScript on February 13, 2021

It is exactly what it sounds. An unknown element.

HTMLUnknownElement is an interface that means an invalid HTML element.

As per W3 cubs docs, it derives from the HTMLElement interface, but without implementing any additional properties or methods.


Image Source: w3cubs

In JavaScript, document.createElement() method creates an HTMLUnknownElement if tagName isn’t recognized.

Syntax of Document.createElement()

let element = document.createElement(tagName[, more options]);

As you can see in the syntax of createElement() above, if it can’t recognize the tagName then it will create HTMLUnknownElement.

Source: MDN


Most Read

#1 How to check if radio button is checked or not using JavaScript? #2 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #3 How to add Read More Read Less Button using JavaScript? #4 How to uninstall Cocoapods from the Mac OS? #5 How to Use SQL MAX() Function with Dates? #6 PHP Login System using PDO Part 1: Create User Registration Page

Recently Posted

Jun 16 What are Stored Procedures for SQL Server? Jun 16 What are Class Constants in PHP? Jun 15 A short basic guide on states in React Jun 15 How to define constants in PHP? Jun 15 How to define visibility for a property in PHP? Jun 15 How to use @if and @else in SCSS?

You might also like these

What’s a Web Storage API in JavaScript?JavaScriptWordPress: How to display slider repeater fields in ACF?WordPressJavaScript Data Types and Data Structures Things to RememberJavaScriptA Quick Guide to Object-Oriented Programming in PHPPHPWordPress: How to print ACF repeater field values?WordPressWhy it’s not a good idea to create Number objects in JavaScript?JavaScriptWhat does it mean by Continuous Integration, Continuous Delivery and Continuous Deployment?MiscIntroduction to components and templates Part 4: Pipes and DirectivesAngularPHP __construct() functionPHPHow to uninstall Cocoapods from the Mac OS?Misc3 Types of Arrays in PHPPHPSorting Arrays in JavaScriptJavaScript