JQuery Key and Value
5 answers
You can access clientId
and Id
how to
var a = {"clientIds":[{"id":0,"clientId":"check123"}]};
alert(a.clientIds[0].clientId);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
+1
source to share
Since it clientIds
is an array, iterate over it.
var data = {"clientIds":[{"id":0,"clientId":"check123"}]};
$.each(data, function(index, element) {
var id = element.id; // will have the value 0
var clientId = element.clientId; // will have the value check123
});
Once you get them, create a dropdown menu.
+1
source to share