Data Structure
 Networking
 RDBMS
 Operating System
 Java
 MS Excel
 iOS
 HTML
 CSS
 Android
 Python
 C Programming
 C++
 C#
 MongoDB
 MySQL
 Javascript
 PHP
- Selected Reading
 - UPSC IAS Exams Notes
 - Developer's Best Practices
 - Questions and Answers
 - Effective Resume Writing
 - HR Interview Questions
 - Computer Glossary
 - Who is Who
 
HTML Articles - Page 127 of 221
 
			
			145 Views
The HTML DOM download property is used to set or return the value of the download attribute of a link.Following is the syntax to set the download property −anchorObject.download = fileAbove, file represents the file name you can set for the file to be downloaded. The actual extension will get suffixed.Following is the syntax to return the download property: anchorObject.downloadLet us now see an example to implement the DOM Anchor download property −Example Live Demo ReactJS Display the value function display() { var val = document.getElementById("myid").download; document.getElementById("demo").innerHTML = val; ... Read More
			 HTML  colspan Attribute
			                              
			
		    
		 
			
 
			
			
			      
                                 Updated on 30-Jul-2019 22:30:26 			      
			       421 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 			      
			       65 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 			      
			       206 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 			      
			       164 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 			      
			       129 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 			      
			       213 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 			      
			       199 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 			      
			       173 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
                    
             
             
             
           
                 
   
   
   
         
       
         
         
         
       
       
         
         
         
       
       
         
         
         
       
      
   
     
 
 
 
 
			
			421 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.
 
			
			65 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
 
			
			206 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
 
			
			164 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.
 
			
			129 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
 
			
			213 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 −
 
			
			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
 
			
			199 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
 
			
			173 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 −