- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2417 Articles for HTML
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
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
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
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
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
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
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
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 −
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
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
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
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 −
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
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
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
0 Views
The readonly attribute of the element is used to set a textarea as readonly. The visitor cannot change the text in the textarea if it is set as readonly.However, visitor can copy that content.Following is the syntax −Let us now see an example to implement the readonly attribute of the element −Example Live Demo Interview Questions Q1 Q2 Guidelines to appear for interview: The interviewee should reach at 10AM with the certificates. OutputIn the above example, we have 3 ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
398 Views
The fillStyle() property of the HTML canvas is used to set the color or gradient or pattern for the drawing. The default is #000000. 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 −ctx.fillStyle=color|gradient|pattern;Above, the values, include −color: The drawing’s fill color, which is a CSS color.gradient: Linear or radial gradient object to fill the drawingpattern: The pattern object to fill the drawing.Let us now see an example to implement the fillStyle() property ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
1K+ Views
The fillRect() method of the HTML canvas is used to create a filled rectangle on the web page. The default color is black. 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 fillRect() method ... Read More