JSchallenger

Return the text of an element on the website

Viewed: 217
Attempted: 86
Solved: 15
// Write a function that takes a string as argument
// The string contains selectors that you can use to access elements on the current page
// Find the first element that matches the selectors
// Return the text content of the element

function myFunction() {

return
}
Test Cases:
myFunction('h1')
Expected
'JSchallenger'
myFunction('nav a')
Expected
'Getting Started'
myFunction('form h1')
Expected
'Return the text of an element on the website'