w3resource

HTML5: How to specify the value of the parameter?

Go to Exercise page

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 value of 
the parameter</title><!-- Title of the document -->
</head><!-- End of head section -->
<body><!-- Start of body section -->
Parameter Value <!-- Textual content indicating parameter value 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 with specified value -->
</object><!-- End of object element -->
</body><!-- End of body section -->
</html><!-- End of HTML document -->

Explanation:

  • This HTML code demonstrates how to specify the value 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 Value" before the <object> element seems to provide a description or context for the parameter value being defined.

Live Demo:

See the Pen param-value-answer by w3resource (@w3resource) on CodePen.


See the solution in the browser

Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
Yes Yes Yes Yes Yes

Go to Exercise page

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/html-css-exercise/basic/param-value-answer.php