Open link on click with jquery after att id append
<p>Hi guys i have a situation like this</p>

<pre><code>&lt;div class="todos-pedidos" title="/pedidos"&gt;See More&lt;/div&gt;
</code></pre>

<p>When click this div its expand my UL / LI with this jquery</p>

<pre><code>$('.todos-pedidos').click(function() {
$('#bloco-pedidos-andamento ul li:hidden:lt(2)').slideToggle();

if( ! $('#bloco-pedidos-andamento ul li').is(':hidden') )
    $('.todos-pedidos').html("&lt;span class='todos-pedidos2'&gt;See All&lt;/span&gt;");
return false;
</code></pre>

<p>when there is no more LI to expand the button change the div text</p>

<p>so i m try for after change the text from see more to see all if the visitor clicks again this go to a url</p>

<p>i tried like this but i think there is some error or conflict, the link dont open</p>

<pre><code>$("span.todos-pedidos2").click(function(event){
    event.preventDefault(); 
    var link = $('.todos-pedidos').attr("title");
    location.href=link;
});
</code></pre>

<p>thanks for any help</p>
