JSchallenger

Accessing multiple elements in the DOM using Javascript

Viewed: 220
Attempted: 67
Solved: 10
// Write a function that takes a number as argument
// There are 3 test cases for this challenge
// For each test case, there is an element on the page with classname 'output'
// Use the number as index for accessing the output element of a test case
// Get the text content of the respective output element
// Transform the text content into a number and return it

function myFunction() {

return
}
Test Cases:
myFunction(0)
Expected
72391
myFunction(1)
Expected
12370982
myFunction(2)
Expected
12380