Found 2417 Articles for HTML

HTML width Attribute

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

110 Views

The width attribute of the element is used to set the width of the canvas in pixels. Following is the syntax −Above, pixels_val is the width set in pixels. Let us now see an example to implement the width attribute of the element −Example Live Demo HTML5 canvas tag isn't supported by your browser. var c = document.getElementById("newCanvas"); var context = c.getContext("2d"); context.fillStyle = "#FF5655"; context.fillRect(100, 50, 60, 100); OutputIn the above example, we have created a canvas and used ... Read More

HTML

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

108 Views

The type attribute of the element is used to set type of the button. Following is the syntax −Above, we have shown the different types set for the button element i.e.: submit −button: A clickable buttonsubmit: Submit button (submits form-data)reset: It is a reset button to reset it to the initial value.Let us now see an example to implement the type attribute of the button element in HTML −Example Live Demo Investor Information Give the information about the investor interested in funding: ID: Investor: Funds: ... Read More

HTML href Attribute

Arjun Thakur
Updated on 29-Jun-2020 09:18:05

143 Views

The href attribute of the element sets the base URL for all relative URLs. For example, base URL as https://example.com/tutorials for all the relative URLs like /html, /java, /jquery etc., which are eventually −https://example.com/tutorials/html https://example.com/tutorials/java https://example.com/tutorials/jqueryFollowing is the syntax −Above, absolute _URL is the absolute url for the base URL. Let us now see an example to implement the href attribute of the element −Example Live Demo    Tutorials List    Java Tutorial(This will act as https://www.example.com/tutorials/java.html)    jQuery Tutorial(This will act as https://www.example.com/tutorials/jquery.html)    Blockchain Tutorial(This will act as https://www.example.com/tutorials/blockchain.html)    Python Tutorial(This will ... Read More

HTML type Attribute

Chandu yadav
Updated on 30-Jul-2019 22:30:26

64 Views

The type attribute of the element sets the MIME (Multipurpose Internet Mail Extensions) type of the target url. Following is the syntax −Above, type_of_media is the standard media type of the linked document, for example, image/bmp, image/tiff, image/tff, etc.Let us now see an example to implement the type attribute of the element −Example Live Demo Learning Learn these technologies with ease....             OutputNow, when you will click on the HTML area, then the following png image would be visible. We have set the media type in that as image/png for the same −

HTML DOM Anchor hreflang Property

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

61 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

6K+ 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

302 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