JavaScript

많이 사용하는 jQuery Selector

기계식키보드 2010. 6. 17. 01:22
$("#TestForm > input[name='TestText']").val();
$("#TestForm > input:radio[name="TestRadio"]:checked").val();// 결과: 1
$("#TestForm > input[name="TestRadio"]:checked").val();// 결과: 1

$("#TestForm > input[name^='TypeA']");
$("#TestForm > input[name$='Desc_1']");
$("#TestForm > input[name*='Desc']");
$("#TestForm > input[name!='TypeA']");


$(":input:radio[name=sample]:checked").val()
$("input[@name=test][@checked]").val()
$("#select_box > option:selected").val();

$("#select_box > option[@value=지정값]").attr("selected", "true")

$(this).parents(".parentTable").find(".targetEl").text("hello?");

$("input[type=text]:not(:first-child)").css({width: "95%"})