Issue With Hiding Ajaxlink After Click

I’m having a hard time figuring out how to manipulate an ajaxLink after the ajax call is successful. Below is my code, why would this not work? How can I do something as simple as hiding the link after the ajax call is successful?

echo CHtml::ajaxLink(

    'Click Me',



        'type' => 'POST',

        'success' => "function( data )




    'data' => array('group_id'=>$group->id, 'action'=>$action)


Check with a tool like firebug what is the value of "this" in the success method.

…or give the link an unique id and do:


This worked, however I was hoping there was a way to use $(this). Thank you.