HTML5: How to specify the name of a parameter?
Solution:
HTML Code:
<!DOCTYPE html><!-- Define document type as HTML5 -->
<html><!-- Start of HTML document -->
<head><!-- Start of head section -->
<meta charset="utf-8"><!-- Define character encoding -->
<title> How to specify the name of
a parameter</title><!-- Title of the document -->
</head><!-- End of head section -->
<body><!-- Start of body section -->
Parameter Name <!-- Textual content indicating parameter name or description -->
<object
data="https://www.w3resource.com/html-
css-exercise/basic/solution/
beach.wav"><!-- Define object element with audio data -->
<param name="autoplay" value="true"><!-- Define parameter for object -->
</object><!-- End of object element -->
</body><!-- End of body section -->
</html><!-- End of HTML document -->
Explanation:
- This HTML code demonstrates how to specify the name of a parameter for an object element, particularly for embedding audio content.
- The <object> element is used to embed an external resource, in this case, an audio file specified by the data attribute.
- Inside the <object> element, a <param> element is used to define parameters for the embedded object.
- The name attribute specifies the name of the parameter, which in this case is "autoplay".
- The value attribute specifies the value of the parameter, which in this case is "true".
- The text "Parameter Name" before the <object> element seems to provide a description or context for the parameter being defined.
Live Demo:
See the Pen param-name-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics