How to get a PHP iteration variable in an external jquery.js file?
<p>I'm writing a PHP program that displays a user's to do list.  What I have is basically an unordered list that has a checkbox that, when checked, will allow the user to mark a list item as done (i.e give the text a strikethrough).  Here's the code I have for the list</p>

<pre><code>echo '&lt;ul&gt;';

for ($i=0; $i&lt;6; $i++){

       $text = "This is item number " . $i;
       $complete = 'No';
       $order = 'This item is to be done #' . $i;

       echo '&lt;li id = '. $i . '&gt;';

    echo 'Item complete? &lt;input type="checkbox" id="checkbox" /&gt;';
    echo '&lt;span id = ' . $i . ' onLoad="crossOut()"&gt;Item: ' . $text . ' Complete? ' .$complete . '&amp;nbsp&amp;nbspWhen to do Item: ' . $order . '&lt;/span&gt;';
    echo '&lt;/li&gt;';

       }

echo '&lt;/ul&gt;';


}
</code></pre>

<p>And here's the jquery function I'm using</p>

<pre><code>$(document).ready(function crossOut(){
    $("#checkbox").change(function crossOutText(){
        if($(this).is(":checked")){
            $("#liID").css("text-decoration", "line-through");
        }
    })
})
</code></pre>

<p>What I'm trying to figure out is how to pass the list ID from the PHP to the jquery function, in an external JS file, so that whenever a user checks an item it marks that list item done and puts a strikethrough on the text of that list item.  I'm new to using jquery and any help that anyone is willing to give would be greatly appreciated. </p>
