francdore
Banned
Hi there,
I really need some help in adding an onclick function on a link to show a div and add a class (active) on the current "a href" tag.
Currently I have this and it works:
<a onclick="$('facebook-submission').show(); return false;"></a>
This shows the div:
<div id="facebook-submission" class="facebook-submission" style="display: none;"></div>
But I also need to add an class on the a href link when it's clicked on. So I want to add something like this:
$(this).addClass('active');
But I want it all in the same onclick "line" like this:
<a onclick="$('facebook-submission').show();$(this).addClass('active'); return false;"></a>
How do I get this to work?
Thank you in advance!
I really need some help in adding an onclick function on a link to show a div and add a class (active) on the current "a href" tag.
Currently I have this and it works:
<a onclick="$('facebook-submission').show(); return false;"></a>
This shows the div:
<div id="facebook-submission" class="facebook-submission" style="display: none;"></div>
But I also need to add an class on the a href link when it's clicked on. So I want to add something like this:
$(this).addClass('active');
But I want it all in the same onclick "line" like this:
<a onclick="$('facebook-submission').show();$(this).addClass('active'); return false;"></a>
How do I get this to work?
Thank you in advance!