Input Checkbox required Attribute
Paglalarawan at Paggamit
required
Ang pagtatakda o pagbalik ng kung dapat ma-check ang check box bago i-sumite ang porma.
Ang katangian na ito ay nagpapakita ng HTML required attribute.
Para sa iba pang pagkakatuturo:
HTML Tagalog Manual:HTML <input> required Attribute
Halimbawa
Halimbawa 1
Tiyakin kung dapat ma-check ang check box bago i-sumite ang porma:
var x = document.getElementById("myCheck").required;
Halimbawa 2
Itago ang check box bilang mahalagang bahagi ng porma na dapat i-sumite:
document.getElementById("myCheck").required = true;
Gramata
I-balik ang required attribute:
checkboxObject.required
I-set ang required attribute:
checkboxObject.required = true|false
Halagang Atribute
Halaga | Paglalarawan |
---|---|
true|false |
Tinutukoy kung dapat o hindi ma-check ang check box bago i-sumite ang porma.
|
Technical Details
Return Value: | Boolean value, if the checkbox must be selected before submitting the form, it returns true , otherwise return false . |
---|
Browser Support
The numbers in the table indicate the first browser version to fully support this attribute.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | Support | Support | Support |