Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Create YT Playlist Link from URLs List</title>
- <script type="text/javascript">
- function replaceFunction() {
- var output = document.getElementById("urlList").value;
- if (output != "") {
- output = output.replaceAll("https://www.youtube.com/watch?v=", ""); // isolate ID strings
- output = output.replace(/\s+/g, ","); // substitute space(s) for comma
- output = document.querySelector('input[name="URLtype"]:checked').value + output;
- document.getElementById("output").innerHTML = output;
- }
- }
- </script>
- <script type="text/javascript">
- function resetFunction() {
- document.getElementById("urlList").value=null;
- document.getElementById("output").innerHTML=null;
- document.getElementById("Mobile").checked = true;
- }
- </script>
- </head>
- <body>
- <h2>Create YT Playlist Link from URLs List</h2>
- <textarea rows='7' cols='50' id='urlList'></textarea><br><br>
- Select a YouTube device:<br>
- <input type="radio" id="Mobile" name="URLtype" value="https://m.youtube.com/watch_videos?video_ids=" checked>Mobile: https://m.youtube.com/watch_videos?video_ids=</input><br>
- <input type="radio" id="PC" name="URLtype" value="https://www.youtube.com/watch_videos?video_ids=">PC: https://www.youtube.com/watch_videos?video_ids=</input><br><br>
- <input type='button' value='Create' onclick='replaceFunction()'/> <input type="button" value="Reset" onClick='resetFunction()'/>
- <br><br>
- <div id="output"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement