How can I parse this home-made string-based data format?
<p>I need to iterate through a dataset of IDs and labels. I got some part of the code right, but I need some assistance. </p>

<pre><code>// 1. String
var string = '1:answer1,2:answer2,3:answer3,4:answer4,5:answer5,'

// 2. Split to array 
var string = string.split(",");

// 3. EACH 
$.each(string, function(key, val) {

    var answer = answer.split(":");
    $.each(answer, function(key1, val1) {
       // output textfield with id of key1 and value of val1 
    });

});
</code></pre>

<p>I can go through the first set of data, that is comma separated, but not the next (:). How do I do that?</p>
