YouTip LogoYouTip

Prop Input Time Required

HTML DOM Input Time required Property

HTML DOM Input Time required Property

-- Learning More Than Just Technology, It's About Dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error

Browser Objects

Window Object Navigator Object Screen Object History Object Location Object Storage Object

DOM Objects

HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection

HTML Objects

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

HTML DOM Input Text Object

<input> - url

Deep Dive

Web Service

Web Design & Development

Web Services

Computer Science

Development Tools

Programming

Programming Languages

Software

Scripting Languages

Scripts

Input Time required Property

Input Time Object Reference Manual Input Time Object

Example

Check if the time field is a required field before submitting the form:

var x = document.getElementById("myTime").required;

x output result is:

true

Try it Β»


Definition and Usage

The required property is used to set or return whether the time field in a form is a required field.

This property reflects the HTML required attribute.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The required property is supported by all major browsers, except Internet Explorer 9 and earlier IE versions, and Safari.

Note: Internet Explorer or Firefox does not support the HTML <input> element with the type="time" attribute.


Syntax

Return the required property:

timeObject.required 

Set the required property:

timeObject.required=true|false

Property Values

Value Description
true|false Specifies whether the time field is a required part of the form before submission.
* true - The time field is a required part of the form.
* false - Default. The time field is an optional part of the form.

Technical Details

Return Value: A Boolean. Returns true if the time field is a required part of the form, otherwise returns false.

More Examples

Example

Set the time field as a required part of the form:

document.getElementById("myTime").required = true;

Try it Β»


Related Pages

HTML <input> required Attribute


Input Time Object Reference Manual Input Time Object

← Prop Input Time TypeProp Input Time Required β†’