How to use JQuery foreach?                The below example describes

How to use JQuery foreach?                The below example describes how to use  foreach in jquery. we
Generic placeholder image

Mukesh R

How to use JQuery foreach?

               The below example describes how to use  foreach in jquery. we can use $.each function to get each data in the array. the parameter "index" gives the position index of the value and  "value" parameter gives the exact value in the array.
 
$(function () {

    var myDataArray = ["1", "2", "3"];
	
    $.each(myDataArray, function (index, value) {
        alert(value);
    });
	
});