how to select tag with attr() method and that attr() have space between string in jquery
for example my attribute is data-compare and this attribute have dynamic value from api
some time data-compare value have space between that string like : 'test test test'
$(`#compare_modal_table td[data-compare=${item}]`)
but this is not work because space is exist between string and console log syntax error
how can i get this ?
Just make this :
$('#compare_modal_table td[data-compare="' + ${item} + '"]')