- 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
HTML colspan Attribute
Updated on 30-Jul-2019 22:30:26
336 Views
The colspan attribute of the element is used to set the number of columns a header cell should span.Following is the syntax −Above, num is the count of columns a header cell should span.Let us now see an example to implement the colspan attribute of the element −Example Live Demo
table, th, td {
border: 2px solid green;
}
Product Expenses
Expenses
Product Development
500000
Marketing
500000
Services
100000
Support
100000
Maintenance
100000
Total Budget = INR 1300000
OutputIn the above example, we have set the column count to span the header cell −ExpensesThe count is 2, therefore two columns will span the header cell.
Updated on 30-Jul-2019 22:30:26
0 Views
The required attribute of the element in HTML is used to let visitors know that this textarea field is to be filled before submitting the form. If a visitor clicks on Submit, without filling the textarea set with required attribute, then the form won’t submit.Following is the syntax −Let us now see an example to implement the required attribute of the element −Example Live Demo Subject-wise rank Student: Subject: Rank: Marks: Remarks OutputIn the above example, we ... Read More
Updated on 12-Jun-2020 08:56:26
142 Views
The shadowBlur property of the HTML canvas is used to set the blur level for shadows. The default value is 0. 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.shadowBlur=num;Above, the num represents the blur level for the shadow.Let us now see an example to implement the shadowBlur property of canvas −Example Live Demo var c = document.getElementById("newCanvas"); var ctx = c.getContext("2d"); ctx.shadowBlur = 20; ... Read More
Updated on 30-Jul-2019 22:30:26
60 Views
The HTML DOM Style lineHeight property is used to set the line height, which is the distance between the lines in a text.Following is the syntax to set the lineHeight property −object.style.lineHeightFollowing is the syntax to return the lineHeight property −object.style.lineHeight = "normal|number|length|%|initial|inherit"Above, the values are described below −normal: Normal line height. Default.number: A number multiplied with the current font size to set the line heightlength: line height in length units%: line height in % of the current font sizeinitial: Sets this property to its default value.inherit: Inherits this property from its parent element.Let us now see an example to implement ... Read More
Updated on 30-Jul-2019 22:30:26
102 Views
The disabled attribute of the is used to disable an option-group. After that, the option-group becomes unclickable. Following is the syntax −Let us now see an example to implement the disabled attribute of the element −Example Live Demo
Water Levels
Impurity Level
3:2
5:3
2L
5L
10L
20L
OutputIn the above example, we have set two option-groups −
3:2
5:3
2L
5L
10L
20L
We have set one of the option-group as disabled −
2L
5L
10L
20L
Now the above options will become disabled and visitors won’t be able to select them.
Updated on 30-Jul-2019 22:30:26
71 Views
The shadowOffsetY property of the HTML canvas is used to set the vertical distance of the shadow from the shape. 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.shadowOffsetY=num;Here, num represents the vertical distance in pixels. Let us now see an example to implement the shadowOffsetY property of canvas −Example Live Demo var c = document.getElementById("newCanvas"); var ctx = c.getContext("2d"); ctx.shadowBlur = 30; ctx.shadowOffsetX = ... Read More
Updated on 12-Jun-2020 08:28:16
136 Views
Use the address object to represent the element. Let us see an example to create −Example Live Demo
Heading Two
Create address element
Display
function display() {
var a = document.createElement("Address");
var node = document.createTextNode("ABC Inc, P 120, Ontario, Canada");
a.appendChild(node);
document.body.appendChild(a);
}
OutputNow, click on the button to display the address −
Updated on 30-Jul-2019 22:30:26
2K+ Views
The stroke() method of the HTML canvas is used to draw the path. This path is drawn with moveTo() and lineTo() method. 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.stroke()Let us now see an example to implement the stroke() method of canvas −Example Live Demo var c = document.getElementById("newCanvas"); var ctx = c.getContext("2d"); ctx.beginPath(); ctx.moveTo(100, 200); ctx.lineTo(100, 100); ctx.strokeStyle = "blue"; ... Read More
Updated on 30-Jul-2019 22:30:26
122 Views
The href attribute of the element sets the the hyperlink target. Following is the syntax −Above, URL is the hyperlink you need to mention for the area, which can be a relative link, absolute link, script, protocol, etc.Let us now see an example to implement the href attribute of the element −Example Live Demo Learning Learn these technologies with ease.... OutputIn the above example, we have set the map on the following image −Now, we have set the map and area within it for shape − ... Read More
Updated on 30-Jul-2019 22:30:26
112 Views
The HTML DOM Object name property sets or returns the value of the name attribute. However, the name attribute only sets the name.Following is the syntax to set the object name property −obj.nameFollowing is the syntax to return the object name property −obj.name = nameLet us now see an example to implement the DOM Object name property −Example Live Demo
Change the object name
function display() {
document.getElementById("obj1").name = "obj2";
document.getElementById("demo").innerHTML = "Name updated to obj2";
}
OutputNow, click the button to update the object name −
Advertisements
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
336 Views
The colspan attribute of the element is used to set the number of columns a header cell should span.Following is the syntax −Above, num is the count of columns a header cell should span.Let us now see an example to implement the colspan attribute of the element −Example Live Demo table, th, td { border: 2px solid green; } Product Expenses Expenses Product Development 500000 Marketing 500000 Services 100000 Support 100000 Maintenance 100000 Total Budget = INR 1300000 OutputIn the above example, we have set the column count to span the header cell −ExpensesThe count is 2, therefore two columns will span the header cell.
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
0 Views
The required attribute of the element in HTML is used to let visitors know that this textarea field is to be filled before submitting the form. If a visitor clicks on Submit, without filling the textarea set with required attribute, then the form won’t submit.Following is the syntax −Let us now see an example to implement the required attribute of the element −Example Live Demo Subject-wise rank Student: Subject: Rank: Marks: Remarks OutputIn the above example, we ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
142 Views
The shadowBlur property of the HTML canvas is used to set the blur level for shadows. The default value is 0. 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.shadowBlur=num;Above, the num represents the blur level for the shadow.Let us now see an example to implement the shadowBlur property of canvas −Example Live Demo var c = document.getElementById("newCanvas"); var ctx = c.getContext("2d"); ctx.shadowBlur = 20; ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
60 Views
The HTML DOM Style lineHeight property is used to set the line height, which is the distance between the lines in a text.Following is the syntax to set the lineHeight property −object.style.lineHeightFollowing is the syntax to return the lineHeight property −object.style.lineHeight = "normal|number|length|%|initial|inherit"Above, the values are described below −normal: Normal line height. Default.number: A number multiplied with the current font size to set the line heightlength: line height in length units%: line height in % of the current font sizeinitial: Sets this property to its default value.inherit: Inherits this property from its parent element.Let us now see an example to implement ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
102 Views
The disabled attribute of the is used to disable an option-group. After that, the option-group becomes unclickable. Following is the syntax −Let us now see an example to implement the disabled attribute of the element −Example Live Demo Water Levels Impurity Level 3:2 5:3 2L 5L 10L 20L OutputIn the above example, we have set two option-groups − 3:2 5:3 2L 5L 10L 20L We have set one of the option-group as disabled − 2L 5L 10L 20L Now the above options will become disabled and visitors won’t be able to select them.
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
71 Views
The shadowOffsetY property of the HTML canvas is used to set the vertical distance of the shadow from the shape. 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.shadowOffsetY=num;Here, num represents the vertical distance in pixels. Let us now see an example to implement the shadowOffsetY property of canvas −Example Live Demo var c = document.getElementById("newCanvas"); var ctx = c.getContext("2d"); ctx.shadowBlur = 30; ctx.shadowOffsetX = ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
136 Views
Use the address object to represent the element. Let us see an example to create −Example Live Demo Heading Two Create address element Display function display() { var a = document.createElement("Address"); var node = document.createTextNode("ABC Inc, P 120, Ontario, Canada"); a.appendChild(node); document.body.appendChild(a); } OutputNow, click on the button to display the address −
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
2K+ Views
The stroke() method of the HTML canvas is used to draw the path. This path is drawn with moveTo() and lineTo() method. 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.stroke()Let us now see an example to implement the stroke() method of canvas −Example Live Demo var c = document.getElementById("newCanvas"); var ctx = c.getContext("2d"); ctx.beginPath(); ctx.moveTo(100, 200); ctx.lineTo(100, 100); ctx.strokeStyle = "blue"; ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
122 Views
The href attribute of the element sets the the hyperlink target. Following is the syntax −Above, URL is the hyperlink you need to mention for the area, which can be a relative link, absolute link, script, protocol, etc.Let us now see an example to implement the href attribute of the element −Example Live Demo Learning Learn these technologies with ease.... OutputIn the above example, we have set the map on the following image −Now, we have set the map and area within it for shape − ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
112 Views
The HTML DOM Object name property sets or returns the value of the name attribute. However, the name attribute only sets the name.Following is the syntax to set the object name property −obj.nameFollowing is the syntax to return the object name property −obj.name = nameLet us now see an example to implement the DOM Object name property −Example Live Demo Change the object name function display() { document.getElementById("obj1").name = "obj2"; document.getElementById("demo").innerHTML = "Name updated to obj2"; } OutputNow, click the button to update the object name −