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

Popular Categories





print dynamic value by java script

+3 votes
60 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 132 views
+2 votes
1 answer 185 views
+6 votes
1 answer 2,270 views
+2 votes
3 answers 314 views
asked in Programming by jatin Expert (3,823 points)
+1 vote
1 answer 159 views
asked in Programming by amit_pammu Expert (5,030 points)
–1 vote
0 answers 153 views
+2 votes
1 answer 847 views
+2 votes
1 answer 177 views
0 votes
0 answers 81 views
+2 votes
1 answer 133 views

Not a Member yet?

Ask to Folks Login

My Account
698 Folks are online
5 members and 693 guest online
Your feedback is highly appreciated