2011-10-13 6 views
0

입력란에 type = hidden을 입력하고 싶은데 끝에는 '1_id'가 있어야 RegEx를 찾을 수 없습니다. 이 Regap Asap에서 친절히 도와주세요. 당신의 id이 경우,마지막 부분 ID를 검색하고 싶습니다

$('input[id$="1_id"]') 

link to the jquery doc

Btw는 것입니다 : 감사

JQUERY 
$('input[type=hidden]# $=*1_id') 
Example HTML 
<input id="sign_up_parameter_questions_attributes_1_id" type="hidden" value="15" name="sign_up_parameter[questions_attributes][1][id]"> 

이상적으로 위 JQuery와 당신은 정규식이 필요하지 않습니다이 태그

+0

presto! - http://api.jquery.com/attribute-ends-with-selector/ – JohnP

답변

1

를 찾을 수 있어야 지정 은 정말로 고유 한입니다. 다음과 같이 사용하면됩니다.

$('[id$="1_id"]') 
관련 문제