HTML classid Attribute

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Legacy & Embed

Introduction

The classid attribute in HTML is used with the <object> element to specify the location or identifier of an object’s implementation, typically for embedding ActiveX controls in legacy web pages. It was more common in older versions of Internet Explorer and has largely been deprecated in modern web development due to security concerns and the shift toward standardized HTML5 technologies.

What You’ll Learn

01

object

On embed.

02

clsid:

ActiveX ID.

03

URI value

Impl URL.

04

param

Pass options.

05

.classid

JS property.

06

vs class

Different.

Purpose of classid Attribute

The primary purpose of the classid attribute is to define the URI or programmatic identifier (CLSID) of the embedded object that the browser should load. It tells the browser where to find the code necessary to run the plugin or control—historically ActiveX in Internet Explorer.

💡
Not the same as class

classid identifies an embedded object implementation on <object>. The class attribute assigns CSS class names for styling. They are completely unrelated despite similar names.

📝 Syntax

Add classid to an <object> element with a URI or CLSID value:

classid.html
<object classid="clsid:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" width="400" height="300">
  <p>Fallback content</p>
</object>

Syntax Rules

  • Used on <object> (and legacy <applet>).
  • Value is a URI—often clsid: followed by a GUID for ActiveX.
  • Pair with <param> elements to pass configuration to the control.
  • Always include fallback content inside <object>.
  • For modern media, prefer data on object, or <video>, <iframe>.

💎 Values

The value of the classid attribute is typically a URI that points to the object implementation. Common forms include:

URL

Specifies the location of the object implementation:

classid-url.html
<object classid="http://www.example.com/someobject">
  <p>Fallback</p>
</object>

CLSID (ProgID / ActiveX)

A unique identifier for a COM/ActiveX control:

classid-clsid.html
<object classid="clsid:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX">
  <p>Fallback</p>
</object>

⚡ Quick Reference

Value TypeExampleModern Alternative
CLSID URIclsid:GUIDNative HTML5 / JavaScript APIs
HTTP URIhttp://example.com/plugindata attribute or <iframe>
Element<object><embed>, <video>
Config<param name="...">JS options / attributes
JS accessobject.classidRarely needed today
HTML5 statusLegacy / obsoleteAvoid in new projects

Applicable Elements

ElementSupported?Notes
<object>Yes (legacy)Primary element for classid
<applet>ObsoleteJava applets; removed from HTML5
<embed>NoUses src or type instead
<div class="...">NoThat is the CSS class attribute
<iframe>NoUses src for embedded documents

Examples Gallery

URL and CLSID classid values, object with param, and dynamic JavaScript classid.

👀 Live Preview

Legacy <object> markup (modern browsers show fallback content):

object with classid — ActiveX controls do not run in modern browsers. Fallback text appears instead.

URL Value Example

index.html
<object classid="http://www.example.com/someobject" width="300" height="200">
  <p>Your browser does not support this object.</p>
</object>

Implementation Example

Let’s look at an example of how the classid attribute might have been used in an HTML document:

index.html
<object classid="clsid:CLSID-ExampleID" width="400" height="300">
  <param name="paramName" value="paramValue">
  <p>Your browser does not support embedded objects.</p>
</object>

How It Works

In this example, the classid attribute specifies the CLSID of an ActiveX control. The <param> tags pass configuration values to the control. If the browser cannot load the object, the fallback paragraph is shown.

Dynamic Values with JavaScript

You can dynamically set the classid attribute using JavaScript when the embedded object must change based on conditions:

index.html
<object id="dynamicObject" width="200" height="100">
  Your browser does not support this object.
</object>

<script>
  document.getElementById("dynamicObject").classid =
    "clsid:NEW-EXAMPLE-ID";
</script>

How It Works

In this script, the classid property is set dynamically on the object with id dynamicObject. This was used in legacy applications to swap ActiveX controls at runtime.

♿ Accessibility

  • Provide fallback content — Always include accessible text inside <object> when plugins fail.
  • Avoid plugin-only features — Do not rely on ActiveX for essential functionality.
  • Use native HTML — Video, audio, and canvas are more accessible than legacy plugins.
  • Title attributes — Describe embedded content when using iframes as replacements.
  • Keyboard access — Plugin content often lacked proper keyboard support.

🧠 How classid Works

1

Author sets classid

Add a URI or clsid: value on <object>.

Markup
2

Browser loads plugin

Legacy IE attempted to instantiate the COM/ActiveX control.

Plugin
3

Params configure control

<param> elements pass name/value pairs to the object.

Config
=

Embedded control (legacy)

Modern browsers skip ActiveX and show fallback content instead.

Browser Support

The classid attribute for ActiveX is obsolete. It was primarily supported in legacy Internet Explorer and is not used in modern browsers.

⚠️ Legacy IE · Obsolete

Not for new projects

Use <iframe>, <video>, <embed>, or JavaScript APIs instead.

Legacy IE ActiveX only
Google Chrome Not supported
Obsolete
Mozilla Firefox Not supported
Obsolete
Apple Safari Not supported
Obsolete
Microsoft Edge Not supported
Obsolete
classid ActiveX Obsolete

Bottom line: Learn classid for legacy maintenance only. Do not use ActiveX or classid in new web applications.

💡 Best Practices

✅ Do

  • Learn classid when maintaining legacy intranet apps
  • Include fallback content inside <object>
  • Use <iframe> or native HTML5 for new embeds
  • Distinguish classid from CSS class
  • Document security risks of ActiveX for stakeholders

❌ Don’t

  • Use ActiveX or classid in new public websites
  • Confuse classid with the class attribute
  • Rely on plugins for essential functionality
  • Skip fallback content when object fails
  • Ignore browser security policies around plugins
  • Security considerations: Due to vulnerabilities associated with ActiveX controls, modern web development generally avoids the classid attribute.
  • Browser compatibility: classid is not supported by most modern browsers. Provide alternative content for all users.
  • Deprecation: classid for ActiveX is obsolete. Use current methods such as <embed>, <iframe>, or native HTML5 elements.

Conclusion

While the classid attribute was once a key part of embedding ActiveX controls and other objects in HTML documents, it has largely fallen out of use due to security issues and the evolution of web standards.

Understanding its purpose and usage can be valuable for maintaining legacy systems, but modern web development should prioritize secure, widely supported technologies.

Key Takeaways

Knowledge Unlocked

Five truths every developer should know about classid

Bookmark these when reading legacy HTML.

5
Core concepts
📝 02

clsid:

ActiveX ID.

Value
⚠️ 03

Obsolete

Legacy IE.

Status
⚙️ 04

.classid

JS property.

Script
🎨 05

vs class

Not CSS.

Compare

❓ Frequently Asked Questions

It specifies the URI or CLSID of an embedded object’s implementation on <object>, historically for ActiveX.
No. classid identifies a plugin implementation. class assigns CSS styling hooks.
A clsid: URI with a GUID that identifies a COM/ActiveX control, e.g. clsid:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
No for new projects. Use iframe, video, embed, or JavaScript. classid is for legacy maintenance only.
Assign objectElement.classid = "clsid:..." or use setAttribute("classid", value).
<iframe>, <video>, <audio>, <canvas>, and Web APIs replace ActiveX embeds.

Understand legacy embedded objects

Explore the obsolete classid attribute on <object> and learn why modern sites use iframe and HTML5 instead.

Try object example →

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