What is HTML <param> Tag?
The HTML param tag is used to define parameters for plugins or embedded objects. It is mainly used with the object tag to pass values such as settings, file names, autoplay options, or other configurations required by media players, Java applets, or custom embedded content.
This tag is important because it allows you to control how embedded content behaves on a webpage. It helps configure object elements by adding name–value pairs. The param tag must be placed inside the object tag, and multiple param tags can be used to define multiple settings.
Syntax of the HTML <param> Tag
<object data="file.ext" type="media_type">
<param name="parameterName" value="parameterValue">
</object>
name specifies the parameter name and value provides the parameter value that controls the behavior of the embedded object.
Examples of HTML <param> Tag
Example 1: Basic HTML Param Tag
<!DOCTYPE html>
<html lang="en">
<body>
<object data="movie.mp4" type="video/mp4">
<param name="autoplay" value="true">
</object>
</body>
</html>
In this basic example, the param tag is used to enable autoplay for a video embedded using the object tag.
Example 2: SEO Optimized Param Tag
<!DOCTYPE html>
<html lang="en">
<body>
<object data="promo-video.mp4" type="video/mp4">
<param name="autoplay" value="true">
<param name="controls" value="true">
<param name="title" value="Web Development Course Promo - Scholar247">
</object>
</body>
</html>
This example includes multiple param tags to enhance user experience. It adds autoplay, enables controls, and includes an SEO-friendly title parameter to improve accessibility and clarity for both users and search engines.
Attributes of the HTML <param> Tag
The main attributes of the param tag are:
• name: Specifies the name of the parameter.
• value: Provides the value for the parameter.
• type: Specifies the data type of the value.
Best Practices for HTML <param> Tag
• Use clear and descriptive parameter names for better maintainability.
• Add only required parameters to avoid unnecessary load on embedded content.
• Ensure values are correct based on the type of object you are embedding.
• Provide alternative content for browsers that do not support object and param tags.
• Test embedded objects on multiple devices to ensure proper functionality.
FAQs About the HTML <param> Tag
Q1: What is the purpose of the HTML param tag?
The param tag is used to pass parameters to embedded content such as videos, audio, plugins, or objects to control their behavior.
Q2: Can the param tag be used without the object tag?
No, the param tag must be placed inside the object tag. It cannot be used independently.
Q3: Does the param tag support multiple attributes?
It mainly supports three attributes: name, value, and type. The most commonly used attributes are name and value.
Q4: Can I use multiple param tags within one object tag?
Yes, you can use multiple param tags to define different settings for the same embedded object.
Q5: Is the param tag still commonly used in modern HTML?
It is less common today because many embedded elements now use HTML5 tags like video and audio. However, it is still useful for legacy content and certain plugins.