param element

If you don't know what an element is or how you must use it, I recommend you read the "HTML tags and attributes" tutorial that you can find in the HTML tutorials section.

Description

The param element provides parameters for resources embedded with the object element. These parameters are passed to the plugin in charge of processing or executing the object and therefore, are only necessary when the object is representing a resource invoking a plugin.

To define parameters, authors have available two attributes, both required, which are name and value. Together, they allow to specify a name and a value for the parameters they define.

The attributes type and valuetype have become invalid in HTML5. Authors are adviced to drop their use.

Examples

In this first example we'll be inserting an interactive Flash movie with object, while we provide some parameters for the plugin with the param element, which in this case are: the movie it needs to load ("movie"), the quality it should use to reproduce it ("quality") and how its background should be filled ("wmode").

The proper representation of this and the next example depends exclusively on the availability of the required plugins in the visitor's browser. This is a downside of embedded conent, as plugins are not always globaly supported.

<object data="/assets/flash/light-bulb.swf" type="application/x-shockwave-flash" width="180" height="350">
  <param name="movie" value="/assets/flash/light-bulb.swf">
  <param name="quality" value="high">
  <param name="wmode" value="transparent">
</object>

In the second example, we're going to insert a MIDI file. This is another typical type of resource that depends on a plugin. Remember that if you don't have the plugin installed in your browser you won't be able to access the resources inserted with object.

Here, the param will be used to pass a parameter ("autostart") to the plugin in order to instruct it not to start playing the file automatically.

<p>Here you have the MIDI version of "Air on the G string".</p>
<object data="/assets/audio/Bach_Air_on_the_G_string.mid" type="audio/mid">
  <param name="autostart" value="false">
</object>

Here you have the MIDI version of "Air on the G string".

Attributes

Specific attributes

name

A string that represents the name of the parameter. This name will help the plugin or object in identifying the aprameter during its manipulation.

Example

<param name="shouldyou" value="yes">

value

A string representing the value passed to the plugin. This value will be used together with the name in the identification and processing of the parameter.

Example

<param name="lang" value="en">

valuetype

The type of the data provided in the value attribute. Possible values are (case-insensitive):

  • data: the value is passed to the object as a string. This is the default value.
  • ref: the value is a URI pointing to a resource with values definitions. The URI must be passed as is (unresolved).
  • object: the value refers to the id attribute of another object declaration present in the document.

This attribute has become obsolete since the introduction of the HTML5 standard. Its use is no longer recommended.

Example

<param name="lang" value="object1" valuetype="object">

type

The type of the resource pointed in the value attribute, when the valuetype attribute is set to "ref".

This attribute has become obsolete since the introduction of the HTML5 standard. Its use is no longer recommended.

Example

<param name="backgroundmusic" value="http://www.someexamplewqebsite.com/favorite-song.mid" valuetype="ref" type="audio/mid">

Global attributes

For information about global attributes refer to this list of global attributes in HTML5.

Events

Global events

For information about global events refer to this list of global events in HTML5.