AmitDiwan

AmitDiwan

8,390 Articles Published

Articles by AmitDiwan

Page 839 of 839

HTML DOM Anchor text Property

AmitDiwan
AmitDiwan
Updated on 06-Aug-2019 883 Views

The HTML DOM text property associated with the anchor tag () specifies the text part of an anchor tag.For example − Google. Here the text part is Google. Using the text property we can get or change the value of anchor text.SyntaxFollowing is the syntax for −Returning the text property −anchorObject.textSetting the text property −anchorObject.text = sometextExampleLet us see an example for anchor text property − Example site Click the button below to change the text content of the link above. Click it Get Text    function ChangeText() {       document.getElementById("Anchor").text = "Click here ...

Read More

HTML DOM Base href Property

AmitDiwan
AmitDiwan
Updated on 06-Aug-2019 328 Views

The HTML DOM Base href property is associated with the HTML tag. The tag is used to specify the base URL for all relative URLs in the current HTML document. There can be a maximum of one tag in a HTML document. The Base href Property returns the value of href attribute in the base element.SyntaxFollowing is the syntax for −Setting the href property −baseObject.href = URLHere, URL is the base URL.Returning the href property −baseObject.hrefExampleLet us see an example for Base href Property − IMAGES Click the below button to change ...

Read More

HTML DOM Bdo dir Property

AmitDiwan
AmitDiwan
Updated on 06-Aug-2019 185 Views

The HTML DOM Bdo dir property is associated with the HTML element. Here, bdo stands for Bi-Directional Override. The tag is used to override the current text direction which is by default left to right. The bdo dir property sets or returns the dir attribute value of a element. The dir property is compulsory for the element. It specifies the direction of the text flow.SyntaxFollowing is the syntax for −Setting the dir property −bdoObject.dir = "ltr|rtl"Here, ltr is left-to-right text direction, whereas rtl is right-to-left text direction.Returning the dir property −bdoObject.dirExampleLet us see an example for HTML ...

Read More

HTML DOM Bold object

AmitDiwan
AmitDiwan
Updated on 06-Aug-2019 530 Views

The HTML DOM bold object is associated with the html (bold) tag. The tag is used to make the text inside the tag bold .Using the bold object we can access the HTML tag.SyntaxFollowing is the syntax for −Creating a bold object −var x = document.createElement("B");ExampleLet us see an example for the HTML DOM Bold object − Click the below button to create a element with some text CREATE    function createBold() {       var x = document.createElement("B");       var t = document.createTextNode("SAMPLE BOLD TEXT");     ...

Read More

HTML DOM Input DatetimeLocal Object

AmitDiwan
AmitDiwan
Updated on 30-Jul-2019 137 Views

The HTML DOM Input DatetimeLocal Object represents an input HTML element with type datetimeLocal.SyntaxFollowing is the syntax −Creating an with type datetimeLocalvar datetimeLocalObject = document.createElement(“input”); datetimeLocalObject.type = “datetime-local”;AttributesHere, “datetimeLocalObject” can have the following attributes −AttributesDescriptionautocompleteIt defines the value of autocomplete attribute of a datetimeLocal fieldautofocusIt defines if the datetimeLocal field should be focused on initial page load.defaultValueIt sets/returns the default value of datetimeLocal fielddisabledIt defines if datetimeLocal field is disabled/enabledformIt returns a reference of enclosing form that contains the datetimeLocal fieldmaxIt returns/sets the value of max attribute of datetimeLocal fieldminIt returns/sets the value of min attribute of datetimeLocal fieldnameIt ...

Read More

HTML DOM Input DatetimeLocal required Property

AmitDiwan
AmitDiwan
Updated on 30-Jul-2019 153 Views

The HTML DOM Input DatetimeLocal required property determines whether Input DatetimeLocal is compulsory to set or not.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDatetimeLocalObject.requiredSetting required to booleanValueinputDatetimeLocalObject.required = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt is compulsory to set the datetimeLocal field to submit form.falseIt is the default value and to set datetimeLocal field is not compulsory.ExampleLet us see an example of Input DatetimeLocal required property − Input DatetimeLocal required    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {     ...

Read More

HTML DOM Input Email placeholder Property

AmitDiwan
AmitDiwan
Updated on 30-Jul-2019 180 Views

The HTML DOM Input Email placeholder property sets/returns a string generally used to give hints to user of what the input text will look like.SyntaxFollowing is the syntax −Returning string valueinputEmailObject.placeholderSetting placeholder to stringValueinputEmailObject.placeholder = stringValueExampleLet us see an example of Input Email placeholder property − Input Email placeholder    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } ...

Read More

HTML DOM Link href Property

AmitDiwan
AmitDiwan
Updated on 30-Jul-2019 299 Views

The HTML DOM Link href property sets/returns the path/url of a linked document. −SyntaxFollowing is the syntax −Returning href attribute valuelinkObject.hrefSetting href to a stringlinkObject.href = stringBoolean ValuesHere, “string” can be the following −booleanValueDetailspathIt defines the absolute/relative path to a document.urlIt defines the url address of the document to be linked.ExampleLet us see an example for Link href property − Link href Link-href Sales Target Week:    var divDisplay = document.getElementById("divDisplay");    var inputWeek = document.getElementById("WeekSelect");    var extStyle = document.getElementById("extStyle");    divDisplay.textContent = 'Week ...

Read More

HTML DOM Link type Property

AmitDiwan
AmitDiwan
Updated on 30-Jul-2019 157 Views

The Link type property sets/returns the type of a linked document.SyntaxFollowing is the syntax −Returning type attribute valuelinkObject.typeSetting type to a valid valuelinkObject.type = valueNOTE  − valid values include "text/javascript", "text/css", "image/gif", etc.ExampleLet us see an example for Link type property − Link type Link-type    var divDisplay = document.getElementById("divDisplay");    var extStyle = document.getElementById("extStyle");    divDisplay.textContent = 'The linked document type: '+extStyle.type+' is not compatible';    function correctType(){       extStyle.type = 'text/css';       divDisplay.textContent = 'Congrats! The linked document type: '+extStyle.type+' is compatible'; ...

Read More

HTML DOM Input Time min Property

AmitDiwan
AmitDiwan
Updated on 30-Jul-2019 185 Views

The HTML DOM Input Time min property returns/sets min attribute of Input Time.SyntaxFollowing is the syntax −Returning string valueinputTimeObject.minSetting max to string valueinputTimeObject.min = hh:mm:ss.msString ValuesHere, “hh:mm:ss.ms” can be the following −stringValueDetailshhIt defines hour (eg:18)mmIt defines minutes (eg:59)ssIt defines seconds (eg:00)msIt defines milli-seconds (eg:700)ExampleLet us see an example of Input Time min property − Input Time min    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       ...

Read More
Showing 8381–8390 of 8,390 articles
« Prev 1 835 836 837 838 839 Next »
Advertisements