Skip to content
Related Articles

Related Articles

HTML DOM Input URL select() Method

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 02 Feb, 2022

The HTML <input type=”url”> is used to define a field that entered a URL. This input value is automatically validated before submitting the form.

The input URL select() method in HTML DOM is used to select the content of a URL text field. It is an in-built method of input URL Object. Refer to components of a URL from the given link

Approach: Blue background color is added to the content of the URL when the user clicks on the button to show that it’s selected.

  • Parameters: It does not accept any parameter.
  • Return Value: It does not return any value.

Example: This example uses the input URL select() method to select the content inside the URL Field. 


<!DOCTYPE html>
    <title>    DOM Input URL select() Method </title>
        <h1 style="color:green;">GeeksforGeeks</h1>
        <h2>DOM Input URL select() Method </h2>
        <label for="uname"    style="color:green">
            <b>Enter URL</b>
        <input type="url" id="inputID"    placeholder="Enter URL"
        <button type="button" onclick="selectURLMethod()">
            function selectURLMethod() {


HTML DOM Input URL select() Method

HTML DOM Input URL select() Method

Supported Browsers: The list of browsers supported by HTML DOM Input URL select() Method are listed below:- 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!