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

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

thats weird,how this works . suggested approach is data

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.