![]() |
Definition and UsageFor For For Applies toThe
Browser SupportThe |
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The button type attribute</h1>
<form action="/action_page.php" method="get">
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<button type="submit" value="Submit">Submit</button>
<button type="reset" value="Reset">Reset</button>
</form>
</body>
</html>
Embed Example.
Example:
HTML
<embed type="image/jpg" src="https://horje.com/avatar.png">
Input Example.
Example:
HTML
<form action="/action_page.php">
<label for="username">Username: </label>
<input type="text" id="username" name="username"><br>
<input type="submit" value="Submit">
</form>
Link Example.
Example:
HTML
<head>
<link rel="stylesheet" type="text/css" href="theme.css">
</head>
The object type attribute.
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The object type attribute</h1>
<object data="https://horje.com/avatar.png" type="image/jpg" width="500" height="300">
</object>
</body>
</html>
The script type attribute.
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The script type attribute</h1>
<p id="demo"></p>
<script type="text/javascript">
document.getElementById("demo").innerHTML = "Hello JavaScript!";
</script>
</body>
</html>
Source Example.
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The source type attribute</h1>
<audio controls>
<source src="https://file-examples.com/wp-content/storage/2017/11/file_example_MP3_5MG.mp3" type="audio/ogg">
<source src="https://file-examples.com/wp-content/storage/2017/11/file_example_MP3_5MG.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>
Style of This is a heading This is a paragraph.
Example:
HTML
<!DOCTYPE html>
<html>
<head>
<style>
h1 {color:red;}
p {color:blue;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
html type attribute |
Read Full: | HTML Attribute |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Attribute |
Uploaded by: | Admin |
Views: | 87 |
Reffered: https://www.w3schools.com/tags/att_type.asp