[jQuery] Basic - chaining multiple selectors?
Hi there!
Please bare with me if this question is too basic :)
I have the following code:
$(function(){
$("form a.option").click(function(){
$("form input.fileimage:visible").slideUp("slow");
$("form input.fileimage:hidden").slideDown("slow");
});
});
I have an input with the class .fileimage and a link saying "I don't
want to upload an image now"
It works good. Now there's something I would like to do but that I
don't know how to.
When I click the anchor, I would like to change the text as well.
So when the input is there (visible) it stays normal, but when I click
to hide it should say "I want to upload an image now" instead.
I'm trying with $("form a.option").text("new text").end();
But I don't know where to put that, and once it changes the text it
doesn't change back to "I don't want..." when the input is visible.
Can somebody point me out in the right direction here?