Javascript get date from class and add an image
<p>Basically I wanted a way to have Javascript look through my HTML for hidden dates with a certain class, parse the date and check if it is greater than today's date. If that is true add an image to the parent element. It looks like it works but is this the best way to write the code?</p>

<pre><code>$(".myClass").each(function() {
    var u = Date.parse($(this).text());
    var v = [u.valueOf()];
    var t = new Date();
    var d = Date.parse(t)

    if (v[0]&gt;d)
    {
        $($(this).parent()).append("&lt;img src='css/img/new.png' alt='icon' title='New Document' class='documentIconText' /&gt;");
    }
});
</code></pre>
