I have a separate array like
1 1 1
2 2 2
3 3 3
I need to pass this array to JavaScript function as a parameter while onChange action is called.
can anyone give me a suggestion for that?
Thanks.
Don't know if that's an option, but this is how it may work in jQuery:
HTML:
<textarea id="target" />
jQuery:
$(document).ready(function(){
$('#target').change(function() {
var arr1 = [1,2,3];
var arr2 = [1,2,3];
var arr3 = [1,2,3];
var arr = [arr1, arr2, arr3];
//do whatever you want with it
alert(arr);
});
});
I guess you could assign it to some hidden element (like input hidden) and then write some code that would read the arr value from it.
At least that's one of options - I'm not sure what you're trying to achieve.
Hope this helps
onchangein this case? Could you please provide a complete example, preferably with jsfiddle.net demo?