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 add Read More Read Less Button using JavaScript? #2 How to check if radio button is checked or not using JavaScript? #3 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #4 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #5 How to uninstall Cocoapods from the Mac OS? #6 PHP Login System using PDO Part 1: Create User Registration Page

Recently Posted

#Apr 8 JSON.stringify() in JavaScript #Apr 7 Middleware in NextJS #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
You might also like these
Understanding the confusing and handy “This” keyword in JavaScriptJavaScriptColleague UI Basics: The Context AreaColleagueUse SwiperJS to create mobile touch sliders fastMiscellaneousHow to set opacity or transparency using CSS?CSSKilling A Project Part 4: What Would Be Your Top 3 Priorities For Planning The Cancellation?MiscellaneousThe SELECT DISTINCT Statement in SQLSQL/MySQLtransform-origin Property in CSSCSSThe difference between Class declarations and Class expressions in JavaScriptJavaScriptContent types in DrupalDrupalHow to position an image on top of another image using CSS?CSS@forward modules with a prefix in SCSS (Sass)SCSSWhat’s the difference between variables in CSS and SCSS (Sass)?CSS