Why doesn't jquery fadeIn() work with .html()?

前端 未结 3 1202
悲&欢浪女
悲&欢浪女 2020-11-30 21:55

When you click you a checkbox I want the message to fade in slowly.

Why doesn\'t .fadeIn() work in this example?

HTML:

3条回答
  •  我在风中等你
    2020-11-30 22:31

    No fadeIn is done because the #message element is visible, hide it, add the content and fade it in:

    $('#message').hide().html("You clicked on a checkbox.").fadeIn('slow');
    

提交回复
热议问题