YouTip LogoYouTip

Prop Month Required

# Input Month required Property [![Image 8: Input Month Object Reference](#) Input Month Object](#) ## Example Check if the month field is a required field before submitting the form: var x = document.getElementById("myMonth").required; The output of _x_ is: true [Try it Yourself Β»](#) * * * ## Definition and Usage The required property is used to set or return whether the month field in a form is a required field. This property reflects the HTML required attribute. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The required property is supported in all major browsers, except Internet Explorer 9 and earlier IE versions, and Safari. **Note:** Internet Explorer or Firefox does not support the element with the type="month" attribute. * * * ## Syntax To return the required property: _monthObject_.required To set the required property: _monthObject_.required=true|false ## Property Values | Value | Description | | --- | --- | | true|false | Specifies whether the month field is a required part of a form submission. * true - The month field is a required part of the form. * false - Default. The month field is an optional part of the form. | ## Technical Details | Return Value: | A Boolean. Returns true if the month field is a required part of the form, otherwise returns false. | | --- | * * * ## More Examples ## Example Set the month field as a required part of the form: document.getElementById("myMonth").required = true; [Try it Yourself Β»](#) * * * ## Related Pages HTML Reference: (#) * * Input Month Object](#)
← Prop Month TypeProp Month Readonly β†’