HTML DOM Input Week select() Method
Last Updated :
26 Aug, 2022
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 >
function myGeeks() {
var gfg = document.getElementById(
"week_id").select();
}
</ script >
</ center >
</ body >
</ html >
|
Output:
HTML DOM Input Week select() Method
Supported Browsers:
- Google Chrome 20
- Edge 12
- Opera 11
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...