HTML attributes provide additional information about HTML elements and help define their properties, behavior, and characteristics. They are added to HTML tags using attributes and values.
<img src="/images/common/cutecat.png" alt="description of the image">
<script src="script.js"></script>
<iframe src="https://www.example.com" width="500" height="300"></iframe>
<img src="/images/common/cutecat.png" alt="description of the image">
<a href="https://www.lets-coding.com">Click here</a>
<!DOCTYPE html>
<html>
<head>
<title>Class Attribute Example</title>
<style>
.highlight {
color: red;
font-weight: bold;
}
</style>
</head>
<body>
<h1 class="highlight">Hello, World!</h1>
<p>This is an example paragraph.</p>
<p class="highlight">This paragraph is highlighted.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>ID Attribute Example</title>
<style>
#special {
color: blue;
font-style: italic;
}
</style>
</head>
<body>
<h1 id="special">Hello, World!</h1>
<p>This is an example paragraph.</p>
<p id="special">This paragraph is special.</p>
</body>
</html>
<span style="color: red; font-size: 18px;">This text is red and has a font size of 18 pixels.</span>
<!DOCTYPE html>
<html>
<head>
<title>Width and Height Example</title>
</head>
<body>
<img src="/images/common/cutecat.png" alt="Image" width="400" height="300">
<iframe src="https://www.lets-coding.com" width="500" height="300"></iframe>
<video src="/media/video/sample_video_720x480_2mb.mp4" width="800" height="400" controls></video>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Width and Height Example</title>
</head>
<body>
<img src="/images/common/cutecat.png" alt="Image" width="400" height="300">
<iframe src="https://www.lets-coding.com" width="500" height="300"></iframe>
<video src="/media/video/sample_video_720x480_2mb.mp4" width="800" height="400" controls></video>
</body>
</html>
<a href="https://www.lets-coding.com" target="_blank">Open in a new tab</a>
<input type="text" disabled>
<button disabled>Click Me</button>
<select disabled>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
<textarea disabled>This is a disabled textarea.</textarea>
<input type="text" placeholder="Enter your name">
<input type="text" required>
<textarea required></textarea>
<select required>
<option value="">Select an option</option>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
</select>
<input type="checkbox" checked> Checkbox
<input type="radio" name="gender" value="male" checked> Male
<input type="radio" name="gender" value="female"> Female
<input type="range" min="0" max="100" step="5" data-slider-label="Slider Value">
<input type="date" data-min-date="2023-01-01" data-max-date="2023-12-31">
<input type="color" value="#ff0000" data-color-label="Selected Color">
<div data-user-id="123" data-user-name="John Doe" data-user-role="admin">User Information</div>
<button data-action="delete" data-target-id="456">Delete</button>
<img src="/images/common/cutecat.png" alt="Product Image" data-product-id="789">
<a href="#" data-tooltip="Click here for more information">Hover Me</a>