- Forums
- Javascipt
- Example Of Using For Loop In Javascript
This Page Shows You An Example Of How To Use A For Loop In Javascript So You Can Display Or List All The Element Values Of An Array Using A Looping Values For Each Segment [2199], Last Updated: Mon Jun 24, 2024
Webune Support
Sun Dec 27, 2009
1 Comments
419 Visits
this is just an example of how you can use the for loop in a javascript code:
JAVASCRIPT CODE:
<script type="text/javascript" language="javascript">
function submitted(){
var form = document.myform2
for (i = 0; i < form.elements.length; i++) {
alert(document.getElementById(i).value);
}
}
</script>
http://www.openjs.com/articles/for_loop.php
https://www.webune.com/forums/example-of-using-for-loop-in-javascript.html