Found 2202 Articles for HTML

HTML DOM Anchor hreflang Property

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

120 Views

The HTML DOM Anchor hreflang property is used to set or return the value of the hreflang attribute of a link.Following is the syntax to set the hreflang property −anchorObj.hreflang = language_codeAbove, language_code represents the language of the linked document. This language code examples, include en for English, bn for Bengali, hi for Hindi, fr for French, la for Latin, ru for Russian, etc.Following is the syntax to return the hreflang property −anchorObj.hreflangLet us now see an example to implement the DOM Anchor hreflang property −Example Live Demo Company Products Display href Part Display Host Part Display hreflang ... Read More

Change Background color of a web page using onmouseover property

Arjun Thakur
Updated on 12-Jun-2020 07:20:30

7K+ Views

The onmouseover property allows you set a script when the mouse pointer is moved onto an element. To change the background color, use the HTML DOM backgroundColor property.Let us see an example to implement the onmouseover property and change the background color −Example Live Demo Heading Two    Hover over me to change the background color. OutputNow hover over the text to change the background color of the web page −

HTML canvas rect() Method

George John
Updated on 30-Jul-2019 22:30:26

384 Views

The rect() method of the HTML canvas is used to create a rectangle. The element allows you to draw graphics on a web page using JavaScript. Every canvas has two elements that describes the height and width of the canvas i.e. height and width respectively.Following is the syntax −context.fillRect(p, q, width, height);Above, p: The x-coordinate of the upper-left corner of the rectangleq: The y-coordinate of the upper-left corner of the rectanglewidth: Width of the rectangleheight: Height of the rectangleLet us now see an example to implement the rect() method of canvas −Example Live Demo Your browser does ... Read More

HTML