댓글 1개
14년 전
[펌]
// 뒤쪽에 옵션 추가
$("#myselect").append("<option value='1'>Apples</option>");
$("#myselect").append("<option value='2'>After Apples</option>");
// 앞쪽에 옵션 삽입
$("#myselect").prepend("<option value='0'>Before Apples</option>");
// 옵션변경
$("#myselect").html("<option value='1'>Some oranges</option><option value='2'>More Oranges</option><option value='3'>Even more oranges</option>");
// 인덱스 위치에 따라 옵션 변경
$("#myselect option:eq(1)").replaceWith("<option value='2'>Some apples</option>");
$("#myselect option:eq(2)").replaceWith("<option value='3'>Some bananas</option>");
// 2번째 옵션 셀렉트
$("#myselect option:eq(2)").attr("selected", "selected");
// 해당 텍스트를 가진 옵션 셀렉트
$("#myselect").val("Some oranges").attr("selected", "selected");
// 해당값을 가진 옵션 셀렉트
$("#myselect").val("2");
// 선택 옵션 제거
$("#myselect option:eq(0)").remove();
// 첫번째 옵션 제거
$("#myselect option:first").remove();
// 마지막 옵션 제거
$("#myselect option:last").remove();
// 셀렉트된 옵션 텍스트 리턴
alert($("#myselect option:selected").text());
// 셀렉트된 옵션 값리턴
alert($("#myselect option:selected").val());
// 셀렉트된 인덱스 리턴
alert($("#myselect option").index($("#myselect option:selected")));
// Alternative way to get the selected item
alert($("#myselect option:selected").prevAll().size());
// Insert an item in after a particular position
$("#myselect option:eq(0)").after("<option value='4'>Some pears</option>");
// Insert an item in before a particular position
$("#myselect option:eq(3)").before("<option value='5'>Some apricots</option>");
// Getting values when item is selected
$("#myselect").change(function() {
alert($(this).val());
alert($(this).children("option:selected").text());
});
// 뒤쪽에 옵션 추가
$("#myselect").append("<option value='1'>Apples</option>");
$("#myselect").append("<option value='2'>After Apples</option>");
// 앞쪽에 옵션 삽입
$("#myselect").prepend("<option value='0'>Before Apples</option>");
// 옵션변경
$("#myselect").html("<option value='1'>Some oranges</option><option value='2'>More Oranges</option><option value='3'>Even more oranges</option>");
// 인덱스 위치에 따라 옵션 변경
$("#myselect option:eq(1)").replaceWith("<option value='2'>Some apples</option>");
$("#myselect option:eq(2)").replaceWith("<option value='3'>Some bananas</option>");
// 2번째 옵션 셀렉트
$("#myselect option:eq(2)").attr("selected", "selected");
// 해당 텍스트를 가진 옵션 셀렉트
$("#myselect").val("Some oranges").attr("selected", "selected");
// 해당값을 가진 옵션 셀렉트
$("#myselect").val("2");
// 선택 옵션 제거
$("#myselect option:eq(0)").remove();
// 첫번째 옵션 제거
$("#myselect option:first").remove();
// 마지막 옵션 제거
$("#myselect option:last").remove();
// 셀렉트된 옵션 텍스트 리턴
alert($("#myselect option:selected").text());
// 셀렉트된 옵션 값리턴
alert($("#myselect option:selected").val());
// 셀렉트된 인덱스 리턴
alert($("#myselect option").index($("#myselect option:selected")));
// Alternative way to get the selected item
alert($("#myselect option:selected").prevAll().size());
// Insert an item in after a particular position
$("#myselect option:eq(0)").after("<option value='4'>Some pears</option>");
// Insert an item in before a particular position
$("#myselect option:eq(3)").before("<option value='5'>Some apricots</option>");
// Getting values when item is selected
$("#myselect").change(function() {
alert($(this).val());
alert($(this).children("option:selected").text());
});
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8030 | 9년 전 | 417 | ||
| 8029 | 9년 전 | 340 | ||
| 8028 | 9년 전 | 298 | ||
| 8027 | 9년 전 | 313 | ||
| 8026 | 9년 전 | 383 | ||
| 8025 | 9년 전 | 411 | ||
| 8024 | 9년 전 | 400 | ||
| 8023 | 9년 전 | 425 | ||
| 8022 | 9년 전 | 341 | ||
| 8021 | 9년 전 | 364 | ||
| 8020 | 9년 전 | 367 | ||
| 8019 | 9년 전 | 380 | ||
| 8018 | 9년 전 | 481 | ||
| 8017 | 9년 전 | 563 | ||
| 8016 | 9년 전 | 389 | ||
| 8015 | 9년 전 | 422 | ||
| 8014 | 9년 전 | 347 | ||
| 8013 | 9년 전 | 271 | ||
| 8012 | 9년 전 | 272 | ||
| 8011 | 9년 전 | 479 | ||
| 8010 | 9년 전 | 333 | ||
| 8009 | 9년 전 | 349 | ||
| 8008 | 9년 전 | 320 | ||
| 8007 | 9년 전 | 466 | ||
| 8006 | 9년 전 | 505 | ||
| 8005 |
|
9년 전 | 999 | |
| 8004 | 9년 전 | 387 | ||
| 8003 | 9년 전 | 457 | ||
| 8002 | 9년 전 | 353 | ||
| 8001 |
|
9년 전 | 697 | |
| 8000 | 9년 전 | 458 | ||
| 7999 | 9년 전 | 408 | ||
| 7998 | 9년 전 | 467 | ||
| 7997 | 9년 전 | 338 | ||
| 7996 | 9년 전 | 566 | ||
| 7995 | 9년 전 | 522 | ||
| 7994 | 9년 전 | 406 | ||
| 7993 | 9년 전 | 476 | ||
| 7992 | 9년 전 | 546 | ||
| 7991 | 9년 전 | 295 | ||
| 7990 | 9년 전 | 327 | ||
| 7989 | 9년 전 | 332 | ||
| 7988 | 9년 전 | 761 | ||
| 7987 | 9년 전 | 465 | ||
| 7986 | 9년 전 | 466 | ||
| 7985 | 9년 전 | 546 | ||
| 7984 | 9년 전 | 465 | ||
| 7983 | 9년 전 | 700 | ||
| 7982 | 9년 전 | 559 | ||
| 7981 | 9년 전 | 517 | ||
| 7980 | 9년 전 | 539 | ||
| 7979 | 9년 전 | 528 | ||
| 7978 | 9년 전 | 491 | ||
| 7977 | 9년 전 | 435 | ||
| 7976 | 9년 전 | 894 | ||
| 7975 | 9년 전 | 407 | ||
| 7974 | 9년 전 | 453 | ||
| 7973 | 9년 전 | 633 | ||
| 7972 | 9년 전 | 425 | ||
| 7971 | 9년 전 | 500 | ||
| 7970 | 9년 전 | 343 | ||
| 7969 | 9년 전 | 585 | ||
| 7968 | 9년 전 | 430 | ||
| 7967 | 9년 전 | 413 | ||
| 7966 | 9년 전 | 419 | ||
| 7965 |
|
9년 전 | 1047 | |
| 7964 | 9년 전 | 437 | ||
| 7963 | 9년 전 | 446 | ||
| 7962 | 9년 전 | 445 | ||
| 7961 |
전갈자리남자
|
9년 전 | 540 | |
| 7960 | 9년 전 | 1008 | ||
| 7959 | 9년 전 | 586 | ||
| 7958 | 9년 전 | 436 | ||
| 7957 | 9년 전 | 394 | ||
| 7956 | 9년 전 | 393 | ||
| 7955 | 9년 전 | 497 | ||
| 7954 | 9년 전 | 432 | ||
| 7953 | 9년 전 | 481 | ||
| 7952 | 9년 전 | 402 | ||
| 7951 | 9년 전 | 532 | ||
| 7950 | 9년 전 | 431 | ||
| 7949 | 9년 전 | 422 | ||
| 7948 | 9년 전 | 358 | ||
| 7947 | 9년 전 | 977 | ||
| 7946 | 9년 전 | 492 | ||
| 7945 | 9년 전 | 434 | ||
| 7944 | 9년 전 | 498 | ||
| 7943 | 9년 전 | 429 | ||
| 7942 | 9년 전 | 441 | ||
| 7941 | 9년 전 | 431 | ||
| 7940 | 9년 전 | 931 | ||
| 7939 | 9년 전 | 423 | ||
| 7938 | 9년 전 | 439 | ||
| 7937 | 9년 전 | 328 | ||
| 7936 | 9년 전 | 912 | ||
| 7935 | 9년 전 | 519 | ||
| 7934 | 9년 전 | 506 | ||
| 7933 | 9년 전 | 626 | ||
| 7932 | 9년 전 | 566 | ||
| 7931 | 9년 전 | 625 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기