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 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 PHP Login System using PDO Part 1: Create User Registration Page #6 How to Use SQL MAX() Function with Dates?

Recently Posted

#Aug 15 Is PHP still good for back-end programming? #Aug 10 How to create a multisite network in WordPress? #Aug 3 How to create a circle that follows a cursor using JavaScript and CSS? #Aug 3 How to make a curtain slider using jQuery and CSS? #Aug 2 How to progressively load images and add a blurry placeholder? #Aug 1 How to create a placeholder loader (throbber) using CSS?
You might also like these
What’s a Web Storage API in JavaScript?JavaScriptHow to Find the Highest (or Lowest) Number in an Array in JavaScript?JavaScriptHow to Secure Web or Mobile Browsers?MiscellaneousHow to create a Recent Posts function in WordPress?WordPressHow to apply style to a specific child element using CSS?CSSHow to center an image horizontally and vertically?CSSHow to obfuscate JavaScript code to hide it from View Source?JavaScriptHow to Validate User Name, Email Address and URL in PHP?PHPHow to auto-resize textarea based on text input using JavaScript or jQuery?JavaScriptHow to use @each rule with key-value pair in SCSS?SCSSHow to add a Line Chart in Angular App?AngularHow to use data-* Attributes in HTML?HTML