JavaScript is a high-level, interpreted programming language that conforms to the ECMAScript specification. jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation.
Example:
- Step 1: Open any geeksforgeeks solution page. Like open problem submissions page. Open the page in inspect mode by pressing F12 or through inspect option.
- step 2: Now copy and paste the below javascript code in the console window and press Enter. In 2.5 seconds all the solutions will be listed one by one.
Example:
javascript
javascript: var arr = [];
var i = 1;
for (i = 1; i <= 30; i++) {
var flag = false ;
if (document.getElementsByClassName( "well table whiteBgColor" )
[0].children[0].children[i]) {
var link = document.getElementsByClassName
( "well table whiteBgColor" )
[0].children[0].children[i].lastElementChild.children[0]
.href.trim().toString();
flag = true ;
}
if (!flag) {
break ;
}
arr.push(link);
}
function open_win() {
for ( var i = 0; i < arr.length; i++) {
console.log(arr[i]);
window.open(arr[i]);
}
}
setTimeout( function () {
open_win();
}, 2500);
|
Output:
Note: In the first run of the script a popup will come. We have to allow popups because Chrome wants to know if we want multiple tabs to be used or not. Then re-run the script.
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
23 Jan, 2023
Like Article
Save Article