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

Popular Categories





print dynamic value by java script

+3 votes
54 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 125 views
+2 votes
1 answer 170 views
+6 votes
1 answer 2,043 views
+2 votes
3 answers 303 views
asked in Programming by jatin Expert (3,823 points)
+1 vote
1 answer 154 views
asked in Programming by amit_pammu Expert (5,030 points)
–1 vote
0 answers 145 views
+2 votes
1 answer 705 views
+2 votes
1 answer 171 views
0 votes
0 answers 73 views
+2 votes
1 answer 122 views

Not a Member yet?

Ask to Folks Login

My Account
449 Folks are online
2 members and 447 guest online
Your feedback is highly appreciated