HTML Articles - Page 132 of 221

HTML DOM Anchor origin Property

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

143 Views

The HTML DOM Anchor origin property returns the protocol, hostname and port number of the href attribute value, for example, https://www.demo.com:6064  Following is the syntax−anchorObj.originLet us now see an example to implement the DOM Anchor origin property −Example Live Demo Company Products Display href Part Display origin Display hreflang function display() {    var a = document.getElementById("mylink").href;       document.getElementById("myid").innerHTML = a;    }    function display2() {       var a = document.getElementById("mylink").origin;       document.getElementById("myid").innerHTML = a;    }    function display3() {       var a = document.getElementById("mylink").hreflang;       document.getElementById("myid").innerHTML = a;    } OutputClick on the “Display origin” button−

HTML

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

254 Views

The form attribute of the element is used to specify the forms wherein the button belongs to.Following is the syntax −The id above is the if of the form wherein the button belongs to.Let us now see an example to implement the form attribute of the element−Example Live Demo Points Player: Rank: Points: Click to Submit This will produce the following output. The button is part of the form−In the above example, we have set a form and added form elements− ... Read More

HTML DOM Anchor href Property

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

184 Views

The HTML DOM Anchor href property is used to set or return the href attribute. It returns the url of the link.Following is the syntax to set the anchor href property−anchorObj.href = URLAbove, URL is the url of the link. It can be an absolute, relative or anchor link with a hash.Following is the syntax to return the anchor href property−anchorObj.hrefLet us now see an example to implement the DOM Anchor href property−Example Live Demo Company Our Team Display href Part Display Host Part Display Hostname function display() { var a = document.getElementById("mylink").href; ... Read More

HTML

HTML Tag

George John
Updated on 11-Jun-2020 11:06:00

158 Views

The tag in HTML is used to mark a text that is no longer relevant. This tag was redefined in HTML5 to display a text that is not accurate.Let’s see an example to implement the element −Example Live Demo Exam Results    Result would be announced on 6th June.    New date for results are 7th June. OutputIn the above example, we have set a text which is no longer relevant− Result would be announced on 6th June. The usage of would strike the same text as shown in the above output.

HTML Tag

Chandu yadav
Updated on 29-Jun-2020 08:33:33

152 Views

The q tag in HTML is used to specify a short quotation. The quotation marks get inserted around the text set inside the q tag i.e. the quotation.Following is the attribute −cite: It sets the source url of the quote.Let us now see an example to implement the tag −Example Live Demo Thoughts    Warren Buffett quoted,    It's better to hang out with people better than you. Pick out associates whose behavior is    better than yours and you'll drift in that direction.    Bill Gates quoted,    Your most unhappy customers are your greatest source ... Read More

HTML cite Attribute

Arjun Thakur
Updated on 11-Jun-2020 10:48:31

175 Views

The cite attribute of the element is used to set the source URL of a quote. The source won’t get displayed on the web page, but it is beneficial for the screen readers.Let us now see an example to implement the cite attribute of the element −Example Live Demo What we want? PETA states,    We are the largest animal rights organization in the     world, with more than 6.5 million members and supporters worldwide. We need your continued     support in order to stop cruelty to animals wherever it occurs. OutputIn the above example, ... Read More

HTML max Attribute

Ankith Reddy
Updated on 29-Jun-2020 08:35:45

105 Views

Tha max attribute of the tag in HTML is used to set the maximum value in a progress bar.Following is the syntax −Above, num represents the number in floating-point. It displays how much effort the task necessitates.Let us now see an example to implement the max attribute of the element −Example Live Demo    Windows Build 10.58.89.1       Downloading and Installing:       OutputIn the above example, we have displayed the progress of a task going on using the − We have set the maximum value in the progress bar using the max attribute −max="100"

HTML for Attribute

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

131 Views

The for attribute of the element sets the relationship between the result of the calculation and the elements used in the calculation.Following is the syntax:Above, id is the element id, which sets a separate list of one or more elements with a space. These elements specify the relationship between the result of the calculation and the elements used in the calculation.Let us now see an example to implement the for attribute of the element:Example Live Demo Result 0    100++    = OutputNow, increase the slider and the result would get displayed:

HTML

Arjun Thakur
Updated on 11-Jun-2020 11:10:05

218 Views

The selected attribute in the element pre-selects an option when the page loads. The same option would be visible.Following is the syntax −Let us now see an example to implement the selected attribute of the element −Example Live Demo Educational Qualification Postgraduation    MCA    M.COM    M.TECH    M.Sc OutputIn the above example, we have a to set a drop-down list: MCA M.COM M.TECH M.Sc In that, different options are set with element −MCA M.COM M.TECH M.ScWe have set the default visible option when the page loads using the selected attribute ... Read More

Advertisements