2012-03-07 2 views
0

난 다음 줄을 발견 어떻게 작동합니까?는 우리의 코드에

$("[^unitRow_]:checked") returns 
[ 
<input type=​"checkbox" disabled=​"disabled" checked=​"checked" class=​"global-item-selectAll" id=​"unitRow_x88ce13f5asda6f6_x5e8dasdaa60d76533" name=​"unitRow_x88ce13f5075a26f6_x5e8cc08dsad533" qualification=​"x5e8cc08a6sdad3" unitid=​"x88ce13f5075a26f6">​ 
] 
$(":checked") 
[ 
<input type=​"checkbox" disabled=​"disabled" checked=​"checked" class=​"global-item-selectAll" id=​"unitRow_x88ce13f507as5a26f6_x5e8cc0dsa8a60d76533" name=​"unitRow_x88ce13fgfdg5075a26f6_x5e8cc08a6asd0d76533" qualification=​"x5e8fecc08a60d76533" unitid=​"x88ce13vref5075a26f6">​ 
, 
<option alt=​"Please select" selected=​"selected" style=​"width:​110px;​" title=​"Please select" value>​Please select​</option>​ 
, 
<option alt=​"Please select" style=​"width:​110px;​" title=​"Please select" value>​Please select​</option>​ 
, 
<option value=​"8" selected=​"selected">​Sep​</option>​ 
, 
<option value=​"2011" selected=​"selected">​2011​</option>​ 
] 

감사합니다.

+0

필요한 모든 설명은 여기에 있습니다. http://api.jquery.com/attribute-starts-with-selector/. 우리가 이것을 사용하고있는 HTML을 우리가 볼 수 있다면 우리는 그 문제를 더 잘 발견 할 수있을 것입니다. –

답변

1

이 시도 :

$('[id^="unitRow_"]:checked') 

enter image description here

+0

나는 [[^ unitRow_]]가 맞다는 것을 알지만 왜 내 선택자가 또한 – user872761

+0

@ user872761 일을하는지 알기 때문에'[^ unitRow_]'라고 쓰면 실제로 : 그의 가치가'^ unitRow_'로 시작하는 모든 속성 –

관련 문제