I am trying to select all the anchors contained in a variable that is html as below my code:
var deposti_row = "
<a data-country='uk' data-currency='eur' data-matching='country-currency'> AA </a>
<a data-country='uk' data-currency='eur' data-matching='country'> BB </a>
<a data-country='uk' data-currency='eur' data-matching='none'> CC </a>
"
$("a['data-matching']",$(deposit_row)).each( function(){
console.log(this);
});
But i get the error Syntax error, unrecognized expression: a['data-matching'] . Any help please ?