Latest web development tutorials

HTML DOM Input Week required properties

Input Week Object Reference Input Week Objects

Examples

View week field before submitting the form if required fields:

var x = document.getElementById ( "myWeek") required.;
x The output is:
true

try it"

Definition and Usage

required property sets or returns the week field in a form if a required field.

This property reflects the HTML required attributes.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the required properties, in addition to Internet Explorer 9 and earlier versions of IE, Safari browser.

Note: Internet Explorer or Firefox browser does not support <input type = "week"> element.


grammar

Returns required attributes:

weekObject .required

Set the required properties:

weekObject .required = true | false

Property Value

value description
true | false Describes a week in the fields before the form is submitted if a required part.
  • true - week fields are required parts of the form
  • false - default. week field is optional part of the form.

technical details

return value: Boolean value that, if the week fields are required parts of the form back to true, otherwise false.


More examples

Examples

Set the week field of the form required parts:

. Document.getElementById ( "myWeek") required = true;

try it"


Related Pages

HTML Reference Manual: HTML <the INPUT> required Attribute


Input Week Object Reference Input Week Objects