Obtain an item identifier using the custom label value jquery

advertisements

How can I get element id using the custom tag value jquery ?

<div id="1" tab_id="4" class="div_focus" tabindex="1">This is label A</div>

how can i get value of id where tab_id = 4 using jquery ?


Demo On JsFiddle

try out this selector

$('div[tab_id = "4"]').attr("id")

check : Attribute Equals Selector [name="value"]