Reputation: 3165
I want to output a textarea based on a checkbox. I would like it to fadeIn or Slidedown, beneath the checkbox.
I have a checkbox controlling a input field with JS, like so:
function enable_text(status) {
status = (status) ? false : true; //convert status boolean to text 'disabled'
document.password.myFormName.disabled = status;
}
Can this be done with jQuery for both input and textareas if checked? Which areas of jQuery API should I research?
Many thanks
Upvotes: 1
Views: 883
Reputation: 10246
$(function(){
$('input.anycheckbox').live('click', function(){
$('textarea.txt').slideToggle();
});
});
Upvotes: 1