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.

HTMLUnknownElement

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 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #2 How to add Read More Read Less Button using JavaScript? #3 How to check if radio button is checked or not using JavaScript? #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
Components and Props in ReactReactHow to create two segues with two UIButtons on a single page (Swift 5.0)?SwiftHow to create and store JSON objects in localStorage using JavaScript?JavaScriptGive buttons accessible namesUI/UXIntroduction to Angular modules Part 1: NgModule metadataAngularUNION and UNION ALL in PostgresPostgresUseful (and probably ignored) HTML tags: Part 1HTMLHow get_template_part helps write reusable code in WordPress?WordPressHow to add Go Back button in Swift 5?Swift10 Usability Blunders to AvoidUI/UXWhat is the difference between float and double?MiscellaneousWhat are Class Constants in PHP?PHP