Why this code doesnt work?


#1

I want that code on my click hide description, and i wrote the code that aperently doesnt work, but why?

var main = function main () {
$(".article").click(function(){
$(this).children(".description").show();
});
$(".description").click(function(){
$(this).hide();
});
}
$(document).ready(main);


#2

@devcoder47506,
IMHO this a peculiarity of Bootstrap....
I have not found a way to select the description to add a =click= Eventhandler.

What you could use

var main = function main () {
  $(".article").click(function(){
         $(this).children(".description").toggle();
  });
}
$(document).ready(main);

#3

Damn, i totally forgot that i can use toggle(). Thx leonhard, u help me a lot!!