Reputation: 2363
I need to select the element by custom attribute value where the element type should be image. I know the following selectors to get the element
By element type
var imgElms = $("input[type=image]");
By custom attribute
var cusElms = $("input[myAttr='org']");
I need mix of both selector to get all image element that has custom attribute myAttr='org'.
Upvotes: 3
Views: 2457
Reputation: 318202
You'd mix them by simply using both, like this
$("input[type=image][myAttr='org']")
but note that myAttr
is not a valid attribute, and you should be using data-attributes instead
Upvotes: 5