I want to get the content of multiple Spans. Here is my code:
It’s supposed to give me “111, 222, 333, 444”. It gives me “undefined” instead.
What’s wrong with my code?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, you weren’t actually getting the
innerHTMLproperty, you were getting an undefinedhtmlproperty. Change it toinnerHTMLand it will work.http://jsfiddle.net/4XumV/1/