What is the top secret hidden tag in html5?

HTML (Hypertext Markup Language) doesn’t have any official “secret” tags. However, there are certain lesser-known or less commonly used HTML tags that you might consider “secret” in the sense that they are not widely recognized or used. Here are five such tags:

Capturing User’s Camera

The <input> element in HTML has an attribute called capture that is used in combination with the type="file" attribute to specify whether the user should capture media using a device’s camera or microphone when selecting files for upload. This attribute is particularly useful when dealing with mobile devices.

The capture attribute can take different values:

  • capture="user": This value indicates that the user should be prompted to capture media using their device’s camera or microphone.
  • capture="environment": This value indicates that the user should be prompted to capture media using the rear-facing camera of their device.
  • capture="none": This value indicates that no capture interface should be presented to the user, and the file picker should behave like a regular file input.

Here’s an example of how you can use the capture attribute with the <input> element:

<input type="file" capture="user" accept="image/*">

In this example, when a user clicks on the input field to select a file, they will be prompted to either take a photo or choose an existing photo from their device’s media library.

Please note that the capture attribute might not be supported in all browsers or devices, so it’s important to test its behavior in different environments. Additionally, the accept attribute is used to specify the types of files that can be selected, in this case, only images are allowed (image/*).

marquee

<marquee>: The marquee tag is used to create scrolling text or images. It’s not recommended for modern web development due to accessibility and usability concerns, but it’s still a lesser-known tag.

<marquee>This text will scroll.</marquee>

bgsound

<bgsound>: This tag is used to embed background sound in a web page. Similar to the <marquee> tag, it’s considered outdated and is not supported in many modern browsers.

<bgsound src="bg_music.mp3" loop="infinite">

font

<font>: The <font> tag was used in older versions of HTML to control font size, color, and face. It’s not recommended for use in modern web development due to the separation of style from content using CSS.

<font size="16" color="#000">This is black and larger text.</font>

nobr

<nobr>: This tag was used to prevent line breaks within its content. However, it’s not recommended to use this tag, as it goes against modern web standards. CSS and proper markup are preferred for styling and layout.

<nobr>This text should not break.</nobr>

listing

<listing>: The <listing> tag was used to display preformatted text, similar to the <pre> tag. However, it’s not widely supported and is considered obsolete.

<listing>
  This text
  is preformatted
</listing>

Disable right Clicking

Disabling right-clicking on a web page using HTML can be done using JavaScript. However, it’s important to note that disabling right-clicking is often not recommended because it can hinder user experience and accessibility. Users might rely on right-click functionality for various purposes, such as opening context menus, copying text, and more.

<div class="main-section" oncontextmenu="return false"> this is main section </div>

prevents Right clicking entire web page

<body oncontextmenu="return false"> 

Add Voice Recognition

Voice recognition this method use to add voice search in the input field.

like google search it searches by voice recognition

<input type="text" x-webkit-speech />

time page refresh & redirect

To implement an automatic page refresh and redirection in HTML, you can use the <meta> tag with the http-equiv attribute for refreshing and the <meta> tag with the http-equiv attribute and the content attribute for redirection. However, it’s important to note that using JavaScript is a more flexible and recommended way to achieve these tasks.

Here’s how you can achieve automatic page refresh and redirection using HTML:

Automatic Page Refresh:

You can use the <meta> tag with the http-equiv attribute set to “refresh” to trigger an automatic page refresh after a specified time interval.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="5"> <!-- Refresh after 5 seconds -->
</head>
<body>
<!-- Your page content here -->
</body>
</html>

Automatic Page Redirection:

You can use the <meta> tag with the http-equiv attribute set to “refresh” along with the content attribute to achieve automatic page redirection.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="5;url=https://www.example.com">
</head>
<body>
<!-- Your page content here -->
</body>
</html>

Leave a Comment