Jquery Add Hidden Html Elements
HTML: JQUERY: $(
Solution 1:
Use toggle()
or the related methods:
$("#add").click(function() {
$(".input:first").toggle();
//or:$(".input:first").fadeToggle();
//or:$(".input:first").slideToggle();
});
JS Fiddle demo: slideToggle()
.
References:
Solution 2:
Try toggle : Further reading
$("#add").click(function() {
$(".input:first").toggle();
});
Solution 3:
var cnt=1;
$("#add").click(function() {
if(cnt)
{
$(".input:hidden:first").show()
cnt=0;
}
else{
$(".input:hidden:first").hide()
cnt=1;
}
});
Solution 4:
$("#add").click(function() {
$(".input:hidden:first").toggle();
});
Should do the trick
Solution 5:
You can use .toggle() here
$("#add").click(function() {
$(".input:hidden:first").toggle();
});
Post a Comment for "Jquery Add Hidden Html Elements"