codingtcher.com
Theme Night
Home
Login

Html Attributes

Home » Html » Html Attributes

attributes html

<a href="...">a...</a>   <img src="i..." alt="..." width="..." height="...">
<p style="...;">...</p>   <html lang="en">   <p title="...">...</p>

attributes html

<img src="img_girl.jpg" width="500" height="600">
<a href="https://www.w3schools.com">Visit W3Schools</a>
<p style="color:red;">This is a red paragraph.</p>

html value attribute

<!-- The value attribute is used to for example fill data to an input -->

<input type="text" value="I was already filled" id="textInput">

<!-- The value can be set or copied using JavaScrpit -->
<script>
	// Get your element
	var input = document.getElementById('textInput');
	
	// get the value
	var value = input.value;
	
	// set the value
	input.value = "i was changed";
</script>

what is attributes in html

All HTML elements can have attributes
The href attribute of <a> specifies the URL of the page the link goes to
The src attribute of <img> specifies the path to the image to be displayed
The width and height attributes of <img> provide size information for images
The alt attribute of <img> provides an alternate text for an image
The style attribute is used to add styles to an element, such as color, font, size, and more
The lang attribute of the <html> tag declares the language of the Web page
The title attribute defines some extra information about an element

Html Related Post