2013-08-27 4 views
0

내가 단일 CSV, 또는 null 값을 가질 수검색 CSV는

<div id="hoslist" class="hBlock" data-accredation-list="" 
data-amenty-list="" data-room-list="1,2,3,4" data-loc-id="1"> 

데이터 속성의 각 같은 컨테이너를 값 때문이다. 데이터 속성에서 일치하는 값을 가진 사람들을 필터링하려고합니다.

<script> 
$(document).ready(function(){ 
roomid=1; 
var objlist=$("div[data-room-list]"); 
//this return all div[s] which have this attribute 
//but i am not able to proceed beyond this. 

}); 
</script> 
내가 데이터 속성의 CSV 값을 얻을 수있는 방법

,

업데이트 :.

$(".hBlock").data('data-room-list') //this gives me undefined 

답변

1

$ (". hBlock") ATTR ('데이터 객실 목록'); // 해결책이 될 수 있습니다

+0

이게 이상하게 작동합니다. 제안 된 접근 방식은 [data] (http://stackoverflow.com/questions/8345666/on-select-change-get-data-attribute-value)입니다. – Andrew