Hey there! any question in your mind? Ask It Now!.

Popular Categories





print dynamic value by java script

+3 votes
35 views
asked in Programming by jazs (1,220 points)

i want to  print dynamic value by java script, now i am using this. its static 

<script>
products =["LG","SAMSUNG","LENOVO","HCL","DELL"];
for (var i=0;i<products.length;i++)
{
document.write(products[i] + "<br>");
}
</script>
this shows only these products but now when prouct is coming dynamically so how can i manage them?

1 Answer

0 votes
answered by duke Expert (5,813 points)

you can store these values in array and then print them see this :

var products = [];
for(var i=1; i<=products.length; i++) {
   arr.push(i.toString());
}

this may help you

Related Questions

0 votes
1 answer 99 views
+2 votes
1 answer 138 views
+6 votes
1 answer 1,726 views
+2 votes
3 answers 284 views
asked in Programming by jatin Expert (3,823 points)
+1 vote
1 answer 128 views
asked in Programming by amit_pammu Expert (5,030 points)
–1 vote
0 answers 116 views
+2 votes
1 answer 559 views
+2 votes
1 answer 145 views
0 votes
0 answers 63 views
+2 votes
1 answer 101 views

Not a Member yet?

Ask to Folks Login

My Account
749 Folks are online
56 members and 693 guest online
Your feedback is highly appreciated