I have table cells with attributes data-position-x
and data-position-y
with integer values. I want to find one certain cell by x
and y
values. Is it possible in jQuery? At the moment I can't figure out how I can pass two predicates to construction $('[data-position-x="0"]');
var data = $(". menu-data"). attr("data-title");
You can specify any number of selectors to combine into a single result. This multiple expression combinator is an efficient way to select disparate elements. The order of the DOM elements in the returned jQuery object may not be identical, as they will be in document order.
The [attribute] Selector is an inbuilt selector in jQuery, used to select all the elements with the specified attribute. Syntax: $("[attribute_name]") Parameter: attribute_name: It is the required parameter which specify the attribute to be select.
The multiple attribute selector is what you are looking for:
$('[data-position-x="0"][data-position-y="0"]');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With