I'm trying to interate through a form and print each form element just for learning. I get out put like:
0=> [object Object]
1=> [object Object]
2=> [object Object]
3=> [object Object]
4=> [object Object]
When I expectecd output
...
Here is the code:
<script type="text/javascript">
$(document).ready(function (){
$('input:button').click(function(){
var myData = $('form:first').serializeArray();
jQuery.each(myData, function(i, val){
$("#objData").append(i + '=> ' + val + '<br />');
})
});
});
</script>
When I tried to insert the whole HTML file above it displays as HTML graphics and not text. Hope the above javascript/jQuery is enough to get some help.
Thanks!