Found 10483 Articles for Web Development

HTML canvas shadowBlur Property

Arjun Thakur
Updated on 12-Jun-2020 08:56:26

199 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

HTML disabled Attribute

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

158 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.

HTML canvas shadowOffsetY Property

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

120 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

HTML DOM Address Object

Arjun Thakur
Updated on 12-Jun-2020 08:28:16

206 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 −

HTML canvas stroke() Method

Ankith Reddy
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

HTML href Attribute

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

191 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

HTML DOM Object name Property

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

167 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 −

HTML
autocomplete Attribute

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

149 Views

The autocomplete attribute of the element allows you to set whether the autocomplete for the form should be on or off. The web browser automatically fills the values if the autocomplete is on. This only happens if the user already entered values before.Following is the syntax −Above, on | off values are to be set for autocomplete to appear or not. Set on if you want the browser to complete the entries based on previously entered values, whereas off doesn’t allow to complete the entries.Let us now see an example to implement the autocomplete attribute of the element ... Read More

HTML DOM activeElement Property

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

189 Views

The HTML DOM activeElement property is a read-only property to return the currently focused element in the document.Following is the syntax −document.activeElementLet us now see an example to implement the DOM activeElement property −Example Live Demo Heading Two Click in the element to get the active element. function display() { var a = document.activeElement.tagName; document.getElementById("myid").innerHTML = a; } OutputNow, click the element to display the same currently active element −

HTML canvas shadowColor Property

Arjun Thakur
Updated on 12-Jun-2020 08:00:20

149 Views

The shadowColor property of the HTML canvas is used to set the color for shadow. The default value is #000000.Following is the syntax −ctx.shadowColor=color;Above, set the color for shadow.Let us now see an example to implement the shadowColor property of canvas −Example Live Demo    var c = document.getElementById("newCanvas");    var ctx = c.getContext("2d");    ctx.shadowBlur = 20;    ctx.shadowColor = "gray";    ctx.fillStyle = "blue";    ctx.fillRect(40, 40, 200, 250); Output

Advertisements