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 PHP Login System using PDO Part 1: Create User Registration Page #6 How to uninstall Cocoapods from the Mac OS?

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
Debugging in WordPress Part 2: WP_DEBUG_LOG and WP_DEBUG_DISPLAYWordPressHow to install Gulp with WordPress?WordPressIntroduction to components and templates Part 2: Templates and viewsAngularHow to auto-resize textarea based on text input using JavaScript or jQuery?JavaScriptHow to verify your domain in Google Console with a TXT record?MiscellaneousJavaScript String Properties and MethodsJavaScriptHow to vertically and horizontally align text and image block (without flex or grid) in CSS?CSSHow to progressively load images and add a blurry placeholder?CSSIN Operator in PostgreSQLPostgresKeyValuePipe in Angular 9AngularHow to hide and show menu on scroll using JavaScript and CSS?CSSWordPress: How to setup and get values from an ACF options page?WordPress