[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

appending to a string.

Posted on 2014-07-14
2
Medium Priority
?
104 Views
Last Modified: 2014-07-14
How do I append the i to this string? I keep getting alert is null. But if I do this it works. Thanks.
var el = $("element0").firstChild.nodeValue;

This is not working:
var i = 0;
var el = $('"element' + i + '"').firstChild.nodeValue;
alert(el);
0
Comment
Question by:kadin
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 40195755
var el = $('element' + i.toString()).firstChild.nodeValue;

Open in new window

0
 

Author Closing Comment

by:kadin
ID: 40195765
Thank you very much.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question