Turn this data value into variables?
<p>does anyone know how I can change this script around to be written into variables?
For example, OP1 = true/false, OP2, OP3 etc....</p>

<p>Here's a working fiddle that was created by a helpful member of the stack community :)
<a href="http://jsfiddle.net/SSPax/17/" rel="nofollow">http://jsfiddle.net/SSPax/17/</a></p>

<p>The HTML look like this:</p>

<pre><code>&lt;ul id="myUL"&gt;
    &lt;li&gt;&lt;input type="checkbox" name="special[]" value="op1" /&gt;1&lt;/li&gt;
    &lt;li&gt;&lt;input type="checkbox" name="special[]" value="op2" /&gt;2&lt;/li&gt;
    &lt;li&gt;&lt;input type="checkbox" name="special[]" value="op3" /&gt;3&lt;/li&gt;
&lt;/ul&gt;
&lt;input type="button" name="submit" value="Push Me First" id="nextquestion1" /&gt;
&lt;input type="button" name="submit" value="Push Me Second" id="getStoredValues" /&gt;
</code></pre>

<p>And the script is:</p>

<pre><code>$('#nextquestion1').click(function() {
    $('#myUL :checkbox').each(function () {
        $this = $(this);
        $.data(document.body, $this.attr('value'), $this.is(':checked'));
    });
});

$('#getStoredValues').click(function () {   
    $.each($.data(document.body), function(key, value) {
        alert('Name= '+ key + ' Value= ' + value);
    });
});
</code></pre>
