Prepend insert content inside the matched element at the beginning.

Before insert content before the matched element

On Mon, Mar 9, 2009 at 14:36, mwalsh <enov...@gmail.com> wrote:

>
> Hi,
>
> I'm puzzled why this script works:
>
> $('.toggle').prepend('<a href="#" class="toggler">Collapse</a>').click
> (function() {
>        alert('toggle');
> });
>
> But this one doesn't:
>
> $('.toggle').before('<a href="#" class="toggler">Collapse</a>').click
> (function() {
>        alert('toggle');
> });
>
> I don't understand why!
>
> Thanks for looking.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to