I just want to find the element with a particular value for a custom attribute.
E.g. I want to find a the div
which has the attribute data-divNumber="6"
.
var number = 6;
var myDiv = $('[data-divNumber = number]');
I tried using http://api.jquery.com/attribute-equals-selector/ but what I've done doesn't work.
There is precisely one element with that particular value for the attribute.