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=\
With ES6 you can use string interpolation:
let number = 6; let myDiv = $(`div[data-divNumber="${number}"]`);