카테고리 없음

jQuery 기본 1장

아즈샤 2013. 6. 3. 22:54
반응형
1. 전체 선택자
$(document).ready(function() {
     $('*').css('color', 'Red');
});

2. 태그 선택자
$(document).ready(function() {
     $('h1, p').css('color', 'Red');
});

3. 아이디 선택자
$(document).ready(function() {
     $('#target').css('color', 'Red');
});

4. 클래스 선택자
$(document).ready(function() {
     $('.item').css('color', 'Red');
});

$(document).ready(function() {
     $('.item.select').css('color', 'Red');
});

5. 자식 선택자
$(document).ready(function() {
     $(' body >  *').css('color', 'Red');
});

6. 후손 선택자
$(document).ready(function() {
     $(' body *').css('color', 'Red');
});

$(document).ready(function() {
     $(' input[type=text]').val('Hello jQuery..!');
});

7. jQuery 입력 양식 필터 선택자
$(document).ready(function() {
     setTimeout(function () {
          var value = $('select > option:selected').val();
          alert(value);
     }, 5000);
});

8.jQuery 필터 선택자
 


반응형