Modify the displayAddress function to display the street , city , and state of the location property of the user. Display it in the DIV with a CSS class of details . Use the street, city, state format
help! i am a bigginner programmer and i have no more time to submit this
document.querySelectorAll returns a NodeList, not a single element. You can use the forEach method of the NodeList to set the textContent of each element, like this:
document.querySelectorAll('p').forEach(el => {
el.textContent = 'I’m a paragraph';
});
You also have a syntax error in the textContent you’re trying to set. Is it supposed to be a literal string? If so, you need to close it with another single quote '. The outer parentheses () are also unnecessary.
If it’s not a literal string, remove the leading single quote, and the code within the parentheses also has syntax errors: is Location a function you’re trying to call with street, city, state as parameters? If so, remove the dot, i.e. func(params), not func.(params).