Hello,
I want to hide and show some form in my page.
For each form theres a link, and i want that, when i click on this link,
it hide and show the nearest form of the link.
My code looks like this :
$$('.flagLink').each(function(s){
$(s).observe('click', function(event) {
// here i want to hide and show the nearest form
});
});
I've tried this :
$$('.flagLink').each(function(s){
$(s).observe('click', function(event) {
$(s).next('form').toggle();
});
});
It works but, i would like to be more precise like :
$$('.flagLink').each(function(s){
$(s).observe('click', function(event) {
$(s).next('.flagForm').toggle();
});
});
but the .flagForm selector doesnt work.