HTML valuetype Attribute

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 3 Examples
Legacy & object

Introduction

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.

What You’ll Learn

01

param only

Not for inputs.

02

data

External URL.

03

ref

In-page link.

04

object

Object reference.

05

With value

Pair attributes.

06

Legacy use

Plugins era.

Purpose of valuetype

The 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.

💡
Not the same as input type or value

valuetype is specific to <param>. It has nothing to do with <input type="..."> or the form value attribute on text fields and buttons.

📝 Syntax

Place <param> elements inside <object> with name, value, and optional valuetype:

index.html
<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>

Syntax Rules

  • Only valid on <param> elements.
  • Keywords: data, ref, object.
  • Default is data if omitted.
  • Always pair with name and value on the same <param>.
  • Parent <object> should include fallback content for unsupported embeds.
  • JavaScript: paramElement.setAttribute("valuetype", "ref").

💎 Values

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).
valuetype-values.html
<param name="movie" value="clip.swf" valuetype="data">
<param name="source" value="#mediaBlock" valuetype="ref">
<param name="nested" value="#otherObject" valuetype="object">

⚡ Quick Reference

valuetypevalue meansTypical example
data (default)External URLvalue="movie.swf"
refIn-document element URLvalue="#section-id"
objectAnother object elementvalue="#embedObj"
Element<param> onlyInside <object>
Modern useRare (legacy plugins)Prefer native HTML/CSS/JS
JavaScriptsetAttribute("valuetype", "ref")Runtime switch

Applicable Elements

ElementSupported?Notes
<param>YesOnly element that uses valuetype
<object>ParentContains <param> children
<input>NoUse type and value instead
<embed>NoVoid element; no param children
<meta>, formsNoDifferent attribute families

valuetype vs value vs type

AttributeElementRole
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

Examples Gallery

See classic object/param markup, switch valuetype with JavaScript, and compare all three keyword values.

👀 Live Preview

Typical legacy pattern: a movie param with valuetype="data":

<param name="movie" value="movie.swf" valuetype="data">

Implementation Example

Flash-style object with parameters (historical example for learning):

index.html
<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>

How It Works

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.

Dynamic Values with JavaScript

Change how a parameter value should be interpreted at runtime:

dynamic-valuetype.html
<param id="paramElement" name="movie" value="movie.swf">

<script>
  document.getElementById("paramElement").setAttribute("valuetype", "ref");
</script>

How It Works

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.

Example — all three valuetype keywords

Quick comparison of data, ref, and object:

keywords.html
<!-- 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">

How It Works

The same value attribute holds a string, but valuetype changes its meaning. Choose the keyword that matches where the resource actually lives.

♿ Accessibility

  • Provide fallback content — Text inside <object> when plugins or embeds fail helps all users.
  • Avoid plugin-only experiences — Legacy object/param embeds were often inaccessible; prefer native HTML alternatives.
  • Do not hide critical info in params — Screen readers do not expose param metadata to users.
  • Use descriptive fallback links — Offer downloadable or alternative formats when embeds are unsupported.
  • Modern media — Use <video> with captions instead of opaque plugin objects when possible.

🧠 How valuetype Works

1

object embeds content

Plugin or file.

object
2

param sets options

name + value.

param
3

valuetype interprets

data, ref, object.

Type hint
=

Correct resource load

If plugin active.

Browser Support

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.

⚠️ Legacy · Limited modern relevance

Valid HTML, rarely needed today

Understand it for maintenance and tutorials; use native HTML APIs for new features.

N/A Plugin era
HTML spec Still defined
Legacy
Plugin hosts Mostly removed
Obsolete use
object/PDF Limited params
Varies
New projects Avoid plugins
Prefer native
valuetype practical use Legacy only

Bottom line: Learn for reading old code; do not rely on plugin param chains in new applications.

💡 Best Practices

✅ Do

  • Use valuetype="data" for external file URLs
  • Match valuetype to what value actually contains
  • Include fallback HTML inside <object>
  • Read legacy markup with param/param chains carefully
  • Prefer <video>, PDF links, or iframes today

❌ Don’t

  • Confuse valuetype with input type
  • Assume Flash/plugin params still run in browsers
  • Depend on param metadata for accessibility
  • Omit name and value on param
  • Build new features solely around object plugins
  • Use valuetype so the browser correctly interprets param values when maintaining legacy object embeds.
  • Test across environments if you must support old plugin content.
  • Set valuetype according to whether the value is an external URL, in-document ref, or object id.

🎉 Conclusion

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.

Key Takeaways

Knowledge Unlocked

4 truths every developer should know about valuetype

Bookmark these before your next valuetype implementation.

4
Core concepts
📝 02

Keywords: data (default), ref,

Keywords: data (default), ref, object.

Syntax
⚙️ 03

It describes how to

It describes how to read the value string, not the data itself.

Usage
🔒 04

Mostly legacy today; modern

Mostly legacy today; modern sites rarely need plugin parameters.

Dynamic

❓ Frequently Asked Questions

The attribute is still in the HTML spec for <param>, but the plugin use cases that needed it are obsolete. Treat it as legacy knowledge, not a modern building block.
No. Form controls use type and value with different meanings. valuetype is exclusive to <param>.
Browsers assume data, treating value as a URL to an external resource.
Use ref when value is a URL pointing to another element in the document. Use object when value identifies another <object> element specifically.
Usually not. Simple PDF <object data="..." type="application/pdf"> markup typically works without param children. Params were mainly for plugin configuration.

Explore param valuetype

Try the data example and compare all three keyword values.

See the keyword table →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful