Horje
HTML DOM Input Week select() Method

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



Reffered: https://www.geeksforgeeks.org


HTML

Related
How to create 3D cube using canvas in HTML5 ? How to create 3D cube using canvas in HTML5 ?
HTML Geolocation clearWatch() Method HTML Geolocation clearWatch() Method
HTML &lt;th&gt; charoff Attribute HTML &lt;th&gt; charoff Attribute
How to validate input field in the HTML Form ? How to validate input field in the HTML Form ?
How to add icons in the button in HTML ? How to add icons in the button in HTML ?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
11