Yogesh Chauhan's Blog

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 How to add Read More Read Less Button using JavaScript? #3 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #4 How to uninstall Cocoapods from the Mac OS? #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to Use SQL MAX() Function with Dates?

Recently Posted

#Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface #Jan 14 How to display a student’s individual transcript in Colleague? #Jan 11 How to install PuTTY on a MacOS?
You might also like these
How to Hide HTML elements automatically after few seconds using JavaScript?HTMLHow to overwrite file contents with new content in PHP?PHPINNER JOIN in PostgresPostgresSome interesting HTML Input Attributes to rememberHTMLHow to show confirmation alerts with OK and cancel buttons using Swift 5?Swiftapply_filters function in WordPressWordPress:in-range and :out-of-range selector in CSSCSSA short basic guide on states in ReactReactHow to zoom an image inside a box on hover?CSSfor @each loop in SCSSSCSSSolution for “Yarn build: Failed because of a stylelint error”WordPressHow to add new elements with swing animation using JavaScript and CSS?CSS