👀 Live Preview
Typical legacy pattern: a movie param with valuetype="data":
<param name="movie" value="movie.swf" valuetype="data">
The valuetype attribute is used on <param> elements to specify how the browser should interpret the value attribute. It tells the user agent whether value is an external URL, a reference to another element in the page, or another embedded object.
This attribute was especially important in the era of browser plugins (such as Flash) inside <object> elements. You will see it in legacy HTML, but it is uncommon in modern web apps that use native video, PDF viewers, or JavaScript components instead.
Not for inputs.
External URL.
In-page link.
Object reference.
Pair attributes.
Plugins era.
valuetypeThe valuetype attribute is primarily used with the <param> element, which defines named parameters for an <object> (historically plugins like Flash or Java applets). It indicates how the parameter’s value string should be interpreted so the embedded content can load resources correctly.
Without the correct valuetype, a plugin might treat an in-document reference as a literal filename, or fail to resolve an external URL.
valuetype is specific to <param>. It has nothing to do with <input type="..."> or the form value attribute on text fields and buttons.
Place <param> elements inside <object> with name, value, and optional valuetype:
<object data="movie.swf" type="application/x-shockwave-flash">
<param name="movie" value="movie.swf" valuetype="data">
<param name="quality" value="high">
<p>Fallback content</p>
</object><param> elements.data, ref, object.data if omitted.name and value on the same <param>.<object> should include fallback content for unsupported embeds.paramElement.setAttribute("valuetype", "ref").The valuetype attribute accepts three keywords:
data (default) — The value is a URL pointing to an external resource. The browser treats it as a reference to load from outside the document.ref — The value is a URL that references another element defined in the same HTML document (often a fragment like #id).object — The value identifies another <object> element in the same document (by id).<param name="movie" value="clip.swf" valuetype="data">
<param name="source" value="#mediaBlock" valuetype="ref">
<param name="nested" value="#otherObject" valuetype="object">| valuetype | value means | Typical example |
|---|---|---|
data (default) | External URL | value="movie.swf" |
ref | In-document element URL | value="#section-id" |
object | Another object element | value="#embedObj" |
| Element | <param> only | Inside <object> |
| Modern use | Rare (legacy plugins) | Prefer native HTML/CSS/JS |
| JavaScript | setAttribute("valuetype", "ref") | Runtime switch |
| Element | Supported? | Notes |
|---|---|---|
<param> | Yes | Only element that uses valuetype |
<object> | Parent | Contains <param> children |
<input> | No | Use type and value instead |
<embed> | No | Void element; no param children |
<meta>, forms | No | Different attribute families |
valuetype vs value vs type| Attribute | Element | Role |
|---|---|---|
valuetype | <param> | How to interpret value (data/ref/object) |
value | <param>, <input>, etc. | The actual data string |
type | <object>, <input> | MIME type or input control kind |
name | <param> | Parameter name passed to plugin/object |
See classic object/param markup, switch valuetype with JavaScript, and compare all three keyword values.
Typical legacy pattern: a movie param with valuetype="data":
<param name="movie" value="movie.swf" valuetype="data">Flash-style object with parameters (historical example for learning):
<object data="movie.swf" type="application/x-shockwave-flash">
<param name="movie" value="movie.swf" valuetype="data">
<param name="quality" value="high">
<param name="bgcolor" value="#000000">
</object>valuetype="data" on the movie parameter tells the plugin that value="movie.swf" is an external URL, not an in-page id. Parameters without valuetype default to data.
Change how a parameter value should be interpreted at runtime:
<param id="paramElement" name="movie" value="movie.swf">
<script>
document.getElementById("paramElement").setAttribute("valuetype", "ref");
</script>The script sets valuetype to ref, indicating the value should be read as a reference to another element in the document rather than a standalone file path.
Quick comparison of data, ref, and object:
<!-- External file URL (default) -->
<param name="src" value="asset.swf" valuetype="data">
<!-- In-document element reference -->
<param name="src" value="#media" valuetype="ref">
<!-- Another object element on the page -->
<param name="src" value="#embedObj" valuetype="object">The same value attribute holds a string, but valuetype changes its meaning. Choose the keyword that matches where the resource actually lives.
<object> when plugins or embeds fail helps all users.<video> with captions instead of opaque plugin objects when possible.Plugin or file.
name + value.
data, ref, object.
If plugin active.
The valuetype attribute remains in the HTML specification for <param>, but browser plugins that consumed these parameters are largely gone. You may still see the attribute in archived pages; modern browsers ignore unused object/plugin param chains for most everyday sites.
Understand it for maintenance and tutorials; use native HTML APIs for new features.
Bottom line: Learn for reading old code; do not rely on plugin param chains in new applications.
valuetype="data" for external file URLsvalue actually contains<object><video>, PDF links, or iframes todayvaluetype with input typename and value on paramvaluetype so the browser correctly interprets param values when maintaining legacy object embeds.valuetype according to whether the value is an external URL, in-document ref, or object id.The valuetype attribute clarifies how <param> values should be interpreted inside <object> elements. It was essential for plugin configuration in older web pages and remains part of the HTML vocabulary for that use case.
For new development, focus on native HTML, CSS, and JavaScript. Know valuetype so you can understand and maintain legacy markup confidently.
valuetypeBookmark these before your next valuetype implementation.
valuetype applies only to <param> inside <object>.
Keywords: data (default), ref, object.
It describes how to read the value string, not the data itself.
Mostly legacy today; modern sites rarely need plugin parameters.
Dynamic<param>, but the plugin use cases that needed it are obsolete. Treat it as legacy knowledge, not a modern building block.type and value with different meanings. valuetype is exclusive to <param>.data, treating value as a URL to an external resource.ref when value is a URL pointing to another element in the document. Use object when value identifies another <object> element specifically.<object data="..." type="application/pdf"> markup typically works without param children. Params were mainly for plugin configuration.Try the data example and compare all three keyword values.
5 people found this page helpful