336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

1. jQuery로 선택된 값 읽기

$("#selectBoxoption:selected").val();

$("select[name=name]").val();

2. jQuery로 선택된 내용 읽기

$("#selectBoxoption:selected").text();

3. 선택된 위치

var index =$("#test option").index($("#test option:selected"));

4. Addoptions to the end of a select

$("#selectBox").append("<optionvalue='1'>Apples</option>");

$("#selectBox").append("<optionvalue='2'>After Apples</option>");

5. Addoptions to the start of a select

$("#selectBox").prepend("<optionvalue='0'>Before Apples</option>");

6. Replaceall the options with new options

$("#selectBox").html("<optionvalue='1'>Some oranges</option><option value='2'>MoreOranges</option>");

7. Replaceitems at a certain index

$("#selectBoxoption:eq(1)").replaceWith("<option value='2'>Someapples</option>");

$("#selectBoxoption:eq(2)").replaceWith("<option value='3'>Somebananas</option>");

8. 지정된 index값으로 select 하기

$("#selectBoxoption:eq(2)").attr("selected", "selected");

9. text 값으로 select 하기

$("#selectBox").val("Someoranges").attr("selected", "selected");

10. value값으로 select 하기

$("#selectBox").val("2");

11. 지정된 인덱스값의 item 삭제

$("#selectBoxoption:eq(0)").remove();

12. 첫번째 item 삭제

$("#selectBoxoption:first").remove();

13. 마지막 item 삭제

$("#selectBoxoption:last").remove();

14. 선택된 옵션의 text 구하기

alert(!$("#selectBoxoption:selected").text());

15. 선택된 옵션의 value 구하기

alert(!$("#selectBoxoption:selected").val());

16. 선택된 옵션 index 구하기

alert(!$("#selectBoxoption").index($("#selectBox option:selected")));

17. SelecBox 아이템 갯수 구하기

alert(!$("#selectBoxoption").size());

18. 선택된 옵션 앞의 아이템 갯수

alert(!$("#selectBoxoption:selected").prevAl!l().size());

19. 선택된 옵션 후의 아이템 갯수

alert(!$("#selectBoxoption:selected").nextAll().size());

20. Insertan item in after a particular position

$("#selectBoxoption:eq(0)").after("<option value='4'>Somepears</option>");

21. Insertan item in before a particular position

$("#selectBoxoption:eq(3)").before("<option value='5'>Someapricots</option>");

22. Gettingvalues when item is selected

$("#selectBox").change(function(){

alert(!$(this).val());

alert(!$(this).children("option:selected").text());

});


Posted by 당양부부34

블로그 이미지
주요 토렌트를 블로깅하고 있습니다. 토렌트 순위 등은 다른 사이트를 찾아보세요. 주요 웹툰 순위도 게재했어요 경제를 좋아하는 일산의 행복한 프로그래머입니다.
당양부부34
Yesterday
Today
Total

달력

 « |  » 2024.4
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함