HTML script for Bulk URL Opener

Created on 30 April, 2024 • 198 views • 1 minutes read

HTML code script for URL bulk opener

<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Bulk URL Opener</title>

</head>

<body>

  <h1>Bulk URL Opener</h1>

  <p>Paste your URLs below, one per line, and click "Open URLs" to open them all in new tabs.</p>

  <textarea id="urlList" rows="10" cols="50"></textarea>

  <br>

  <button onclick="openUrls()">Open URLs</button>

  <script>

    function openUrls() {

      // Get the list of URLs from the textarea

      const urlList = document.getElementById("urlList").value;

       

      // Split the list into an array of individual URLs

      const urls = urlList.split("\n");


      // Loop through each URL and open it in a new tab

      for (const url of urls) {

        if (url.trim() !== "") { // Check if URL is not empty

          window.open(url, '_blank');

        }

      }

    }

  </script>

</body>

</html>