troubleshooting Question

asp.net mvc

Avatar of Moti Mashiah
Moti MashiahFlag for Canada asked on
ASP.NET
2 Comments1 Solution113 ViewsLast Modified:
Hi Guys,
I have scenario when I have ul and inside the ul I insert dynamic li with jquery.

Please look at the code:
var rows = $("#addnew_product").append("<li style='font-size:16px'>" + txt + "</li>");

I limited users to insert 4 li in total and after the finish to insert the li I want to grab the text for each li the insert and for this I did something like that.

                var row1 = rows.select("li:nth-child(0)");
                var row2 = rows.select("li:nth-child(1)");
                var row3 = rows.select("li:nth-child(2)");
                var row4 = rows.select("li:nth-child(3)");
The issue with the code above is that each child show the same text and add the last text from the previous row.
My question:
How can I get the text from each dynamic li.?

thanks ,
ASKER CERTIFIED SOLUTION
Lokesh B R
Developer
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros