I have this problem in my JavaScript class:
//===== i set this data record
jQuery(element).data("types", "row");
console.log(jQuery(element).data("types")); // writes "row" (the element is a div)
//==== into other method
//==== i want find all element with data-types = row
console.log(jQuery("[data-types='row']").length); // writes 0
jQuery("div").each(function(i,e){
console.log(i, jQuery(e).data(), jQuery(e).attr("id")); // writes object{type:row}
});
why with this jQuery("[data-types='row']") i can't find elements ???