Found 2416 Articles for HTML

HTML DOM Input Radio required property

AmitDiwan
Updated on 15-Feb-2021 05:03:21

127 Views

The HTML DOM input radio required property is associated with the required attribute of an element. The required property is used for setting and returning if it is necessary to check some radio button or not before the form is submitted to the server. This allows the form to not submit if a radio button with required attribute is left unchecked by the user.SyntaxFollowing is the syntax for −Setting the required property.radioObject.required = true|falseHere, true represents the radio button must be checked while false represents its optional to check the radio button before submitting the form.ExampleLet us look at ... Read More

HTML DOM Input Radio object

AmitDiwan
Updated on 15-Feb-2021 05:05:50

103 Views

The HTML DOM Input radio object is associated with the element with type “radio”. We can create and access an input element with type radio using the createElement() and getElementById() method respectively.PropertiesFollowing are the properties of the Input Radio object −Sr.NoProperties & Description1AutofocusTo set or return if the radio button should get focus automatically when the page loads or not.2CheckedTo set or return the radio button checked state.3defaultCheckedTo return the checked attribute default value for a radio button4defaultValueTo set or return the radio button default value.5DisabledTo set or return whether the radio button should e disabled, or not6FormTo return ... Read More

HTML DOM Input Radio name Property

AmitDiwan
Updated on 15-Feb-2021 05:08:32

73 Views

The HTML DOM Input radio name property is used for setting or returning the name attribute of an input radio field. The name attribute helps in identifying the form data after it has been submitted to the server. JavaScript can also use the name attribute to refer form elements to manipulate later on.SyntaxFollowing is the syntax for −Setting the name property.radioObject.name = nameHere, name is for specifying the radio button name.ExampleLet us look at an example for the radio name property −Live Demo Input radio name Property FRUIT: Orange Change the name of the above radio ... Read More

HTML DOM Input Radio form Property

AmitDiwan
Updated on 21-Aug-2019 06:57:36

75 Views

The HTML DOM Input Radio form property is used for returning the form reference that contains the given input radio button. If the radio button is outside the form then it will simply return NULL. This property is read-only.SyntaxFollowing is the syntax for input radio form property −radioObject.formExampleLet us look at an example for the Input radio form property. Input radio form Property FRUIT: Mango Get the form id by clicking on the below button GET FORM    function formId() {       var P=document.getElementById("Mango").form.id;       document.getElementById("Sample").innerHTML = "The id of ... Read More

HTML DOM Input Radio disabled Property

AmitDiwan
Updated on 15-Feb-2021 05:12:01

2K+ Views

The HTML DOM Input Radio disabled property is used for setting or returning if the radio button should be disabled or not. It uses boolean values with true representing the element should be disabled and false otherwise. The disabled property is set to false by default. The disabled element is greyed out by default and is unclickable .SyntaxFollowing is the syntax to −Set the disabled property.radioObject.disabled = true|false;Here, true= the radio button is disabled and false=the radio button is not disabled. It is false by default.ExampleLet us look at an example for the Input radio disabled property −Live Demo ... Read More

HTML DOM Input Radio defaultChecked Property

AmitDiwan
Updated on 15-Feb-2021 05:14:45

70 Views

The HTML DOM Input Radio defaultChecked property checks whether the radio button has been checked by default or not. It returns true if the radio button is checked otherwise it will return false.SyntaxFollowing is the syntax for Radio defaultChecked property −radioObject.defaultCheckedExampleLet us look at an example of the Radio defaultChecked property −Live Demo Input Radio defaultChecked property FRUIT: Mango CHECK    function checkDefault() {       var c = document.getElementById("Mango").checked;       document.getElementById("Sample").innerHTML = "The button default checked value is "+c;    } OutputThis will produce the following output ... Read More

HTML DOM Input Radio checked Property

AmitDiwan
Updated on 15-Feb-2021 05:18:00

359 Views

The HTML DOM Input Radio checked property is associated with the checked property of an element with type radio. It is used to basically set or return the checked attribute value of the radio button.SyntaxFollowing is the syntax for −Setting the checked property.radioObject.checked = true|falseExampleLet us look at an example for the Radio checked property −Live Demo Input Radio checked property FRUIT: Mango Apple Check Apple    function checkApple() {       document.getElementById("Apple").checked = true;    } OutputThis will produce the following output −On clicking the “Check Apple” button −In the ... Read More

HTML DOM Input Radio autofocus property

AmitDiwan
Updated on 21-Aug-2019 06:42:59

206 Views

The HTML DOM input radio autofocus property is associated with the HTML element’s autofocus attribute. This property is used for setting or returning whether the input radio button automatically be focused when the page loads or not.SyntaxFollowing is the syntax for −Setting the autofocus property.radioObject.autofocus = true|falseHere, true represents the radio button should get focus and false represents otherwise. It is set to false by default.ExampleLet us look at an example for the Input Radio autofocus property − Input password autofocus property RADIO: CHECK FOCUS    function FocusVal() {     ... Read More

HTML DOM Input Password value property

AmitDiwan
Updated on 15-Feb-2021 05:21:55

656 Views

The HTML DOM Input password value property is associated with the input element having type=”password” and having the value attribute. This property is used for specifying a default value for password field and it also changes the value to user input.SyntaxFollowing is the syntax for −Setting the value property.passwordObject.value = text;Here, text is used for specifying the value for the password field.ExampleLet us look at an example for the input password value property −Live Demo Input password Value property PASSWORD: Get the above element value by clicking the below button Get Value    function getValue() ... Read More

HTML DOM Style borderImageRepeat Property

AmitDiwan
Updated on 21-Aug-2019 06:36:09

40 Views

The HTML DOM borderImageRepeat property is used to define how the image slices are repeated in border image. This sets or gets if the borderImage should be rounded, repeated or stretched.SyntaxFollowing is the syntax for −Setting the borderImageRepeat property.object.style.borderImageRepeat = "stretch|repeat|round|initial|inherit"ValuesThe property values are explained as follows −Sr.NoValues & Description1StretchThis makes the image stretched to fill the area. This is the default value.2RepeatThis makes the image is repeated to fill the area.3RoundThe image is usually repeated to fill the area and it is rescaled if it doesn’t fill the area with the whole number of times.4SpaceSame as round but if ... Read More

Advertisements