Open In App

HTML DOM Input Week select() Method

Last Updated : 26 Aug, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The input week select() method in HTML DOM is used in selecting the content of the week field.

Syntax:

weekbject.select()

Parameters: It does not accept any parameter.

Example: This example uses the input week select() method to select the week field.

HTML




<!DOCTYPE html>
<html>
 
<head>
    <title>HTML DOM Input Week select() Method</title>
</head>
 
<body>
    <center>
        <h1 style="color:green">
            GeeksforGeeks
        </h1>
         
        <h2>DOM Input Week Select() Method</h2>
         
        <form id="myGeeks">
            <input type="week" id="week_id"
                name="geeks" autofocus>
        </form>
        <br>
 
        <button onclick="myGeeks()">
            Click Here!
        </button>
         
        <p id="GFG" style="font-size:20px;"></p>
 
 
 
        <!-- Script to select the content of a Input week field-->
        <script>
            function myGeeks() {
                var gfg = document.getElementById(
                    "week_id").select();
            }
        </script>
    </center>
</body>
 
</html>


Output: 

HTML DOM Input Week select() Method

HTML DOM Input Week select() Method

Supported Browsers:

  • Google Chrome 20
  • Edge 12
  • Opera 11


Similar Reads

HTML | DOM Input Week stepDown() Method
The Input Week stepDown() method in HTML DOM is used to decrease the value of the week field by the given number. This method will only decrease the value of weeks not years. Syntax: weekObject.stepDown( number ) Parameters: It accepts single parameter number which is mandatory. It specifies the number of weeks to be decreased. By default, the week
1 min read
HTML DOM Input Week stepUp() Method
The Input Week stepUp() method in HTML DOM is used to increase the value of the week field by the given number. This method will only increase the value of weeks not years. Syntax: weekObject.stepUp( number )Parameters: It accepts a single parameter number which is mandatory. It specifies the number of weeks to be increased. By default, the weeks i
1 min read
HTML | DOM Input Week Object
The Input Week object in HTML DOM represents an &lt;input&gt; element with type = "week" attribute. The element can be accessed by using getElementById() method. Syntax: document.getElementById("id"); where id is assigned to the &lt;input&gt; tag. Property Values: list: It returns the reference of data list that contains the week field.form: It ret
3 min read
HTML | DOM Input Week autofocus Property
The DOM Input Week autofocus property in HTML DOM is used to set or return whether the Input Week Field should get focus or not when the page loads. It reflects the HTML autofocus attribute. Syntax: It returns the autofocus property.weekObject.autofocusIt is used to set the autofocus property.weekObject.autofocus = "true|false" Property Values: tru
2 min read
HTML | DOM Input Week defaultValue Property
The DOM Input Week defaultValue property in HTML DOM is used to set or return the default value of a week field. It is the value specified in the value attribute. Syntax: It returns the defaultValue property.weekObject.defaultValueIt is used to set the defaultValue property.weekObject.defaultValue = value Property Values: value: It specifies the de
2 min read
HTML | DOM Input Week disabled Property
The DOM Input Week disabled property in HTML DOM is used to return a boolean value that represents that a week field should be disabled or not. Disabled elements are shown in gray by default and are unusable and un-clickable. Syntax: It returns the disabled property.weekObject.disabledIt is used to set the disabled property.weekObject.disabled = tr
2 min read
HTML | DOM Input Week type Property
The DOM Input Week type Property is used for returning which type of form element a week field is. Syntax: weekObject.type Return Value: It returns a string value which represent the type of form element the week field is. Below program illustrates the Week type property: Example: Returning the type of form element the Week field is. C/C++ Code
1 min read
HTML | DOM Input Week required Property
The Input Week required Property in HTML DOM is used to set or return whether Input Week Field should be filled or not when submitting the form. This property is used to reflect the HTML required attribute. Syntax: It returns the Input Week required property.weekObject.requiredIt is used to set the Input Week required property.weekObject.required =
2 min read
HTML | DOM Input Week readOnly Property
The DOM Input Week readOnly property in HTML DOM is used to set or return whether the Input Week Field should be read-only or not. It can be copied but can't be modified. Syntax: It returns the readOnly property.weekObject.readOnlyIt is used to set the readOnly property.weekObject.readOnly = "true|false" Property Values: true: It sets the readOnly
2 min read
HTML | DOM Input Week name Property
The Input Week name property in HTML DOM is used to set or return the value of the name attribute of an input week field. The name attribute is required for each input week field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns the Input Week name property.weekObject.
2 min read