html tutorial - data Attribute in HTML - html5 - html code - html form




data attribute in html

Learn html - html tutorial - data attribute in html - html examples - html programs

  • The data attribute defines the URL of the source to be used by the object.

Syntax for data attribute in HTML:

<object data = “URL”>

Applies To:

Element Attribute
<object> data

data Attribute Value:

Value Description
URL Defines the URL of the resource.

Sample Coding for data Attribute in HTML:

Tryit<!DOCTYPE html>
<html>
    <head>
        <title>Wikitechy data attribute</title>
    </head>
    <body>
        <h2>HTML data attribute with example</h2>
        <object width="300" height="300" data="hibiscus.mp4">
        </object>
    </body>
</html>

Code Explanation for data Attribute in HTML:

data Attribute Code Explanation

  1. <object> tag is used to embed a video object within the document.
  2. data is an attribute, which indicates the URL of the video.

Output for data Attribute in HTML:

data Attribute Output

  1. The output shows the specified video.

Browser Support for data Attribute in HTML:

Yes Yes Yes Yes Yes

Related Searches to data Attribute in html