

$('p').click(function(){
if($(this).parent().is('div')){
$(this).css('color', 'blue');
$(this).parent().css('background', 'lightblue');
$(this).parent().css(true).appendTo('body');
}
})
--> is()메소드는 true, false이기 때문에 if문에서 많이 사용된다.
'jQuery' 카테고리의 다른 글
| jQuery Class로 css주기 (0) | 2020.01.13 |
|---|---|
| jQuery 찾기메소드(silblings-end) (0) | 2020.01.13 |
| jQuery end()이용하기 (0) | 2020.01.12 |
| jQuery wrap, unwrap, wrapall 사용하기 (0) | 2020.01.12 |
| jQuery 필터, 메서드 css주기 (0) | 2020.01.12 |
댓글