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=\
div
data-divNumber=\
I think what you need is:
var number = 6; var myDiv = $('[data-divNumber="'+number+'"]');