<div class="room" data-people="jason">
blah blah
</div>
$(".room with attribute "data-people=jason").hide();
我想選擇data-people = jason的房間,然後隱藏它。如何在Javascript中查詢這個?
<div class="room" data-people="jason">
blah blah
</div>
$(".room with attribute "data-people=jason").hide();
我想選擇data-people = jason的房間,然後隱藏它。如何在Javascript中查詢這個?
<div class="room" data-people="jason">
blah blah
</div>
<script>
$(".room[data-people='jason']").hide();
</script>
像這樣:
$(".room[data-people=jason]").hide();
這應該做的伎倆:
$('.room[data-people=jason]').hide();
$('.root[data-people="jason"]').hide()