0

i have a container like

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

each of the data attribute can have the csv ,Single or null values. i am trying to filter those who have matching value in data attribute.

<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>

how can i get csv value of data attribute,

Update :

$(".hBlock").data('data-room-list') //this gives me undefined
Andrew
  • 179
  • 2
  • 15

1 Answers1

1

$(".hBlock").attr('data-room-list'); // may be the solution

  • thats weird,how this works . suggested approach is [data](http://stackoverflow.com/questions/8345666/on-select-change-get-data-attribute-value) – Andrew Aug 27 '13 at 11:20