jQuery .click() .toggle() - change display and swap character
- by danit
Here is my jQuery:
$('.ask').click(function() {
$('.addtitle').slideToggle('fast', function() {
// Animation complete.
});
});
And my HTML:
<p class="ask">+</p>
<div class="addtitle">
<p>Give your Idea a great title</p>
<form name="input" action="#" method="get">
<input id="title" type="text" name="title" />
<input id="go" type="submit" value="Go" />
</form>
</div>
I have multiple .ask div's on the page and I only want it to effect the .next() div named .ask rather than all div's named .ask.
I also want to .toggle() the '+' character to '-'
Can anyone assist?