HTML DOM Input Month select() Method
The input Month select() method in HTML DOM is used in selecting the content of the month text field.
Syntax:
monthObject.select()
Parameters: It does not accept any parameter.
Return Value: It does not return any value.
Example: This example uses the input Month select() method to select the content inside the month Field.
HTML
<!DOCTYPE html> < html > < head > < title > HTML DOM Input Month select() Method </ title > </ head > < body style = "text-align:center;" > < h1 >w3wiki</ h1 > < h2 >DOM Input Month select() Method</ h2 > < form id = "myBeginner" > < input type = "month" id = "month_id" name = "Beginner" autofocus> </ form > < br > < b > < p > Click on the below button to select the content of Month field. </ p > </ b > < button onclick = "myBeginner()" > Click Here! </ button > < p id = "GFG" style = "font-size:20px;" ></ p > <!-- Script to Get the content of a Month field--> < script > function myBeginner() { // select the content of the Input month field . var gfg = document.getElementById( "month_id").select(); } </ script > </ body > </ html > |
Output:
Supported Browsers:
- Google Chrome 20 and above
- Edge 12 and above
- Opera 11 and above