Prop Week Required
# Input Week required Attribute
[ Input Week Object](#)
## Example
Check if the week field is required before submitting the form:
var x = document.getElementById("myWeek").required;
The output of _x_ will be:
true
[Try it Β»](#)
* * *
## Definition and Usage
The required attribute is used to set or return whether the week field in a form must be filled out before submitting the form.
This attribute reflects the HTML required attribute.
* * *
## Browser Support

The required attribute is supported in all major browsers, except Internet Explorer 9 and earlier versions of IE, and Safari.
**Note:** Internet Explorer and Firefox do not support the element.
* * *
## Syntax
To return the required attribute:
_weekObject_.required
To set the required attribute:
_weekObject_.required=true|false
## Property Values
| Value | Description |
| --- | --- |
| true|false | Specifies whether the week field must be filled out before submitting the form. * true - The week field is a required part of the form * false - Default. The week field is an optional part of the form. |
## Technical Details
| Return Value: | A Boolean. Returns true if the week field is a required part of the form, otherwise returns false. |
| --- |
* * *
## More Examples
## Example
Set the week field as a required part of the form:
document.getElementById("myWeek").required = true;
[Try it Β»](#)
* * *
## Related Pages
HTML Reference: (#)
* * Input Week Object](#)
YouTip