I have a few html object with the same data-id number (data-id=9)
Is it possible to change the style of these objects by the condition data-id=9 in jquery?
I have a few html object with the same data-id number (data-id=9)
Is it possible to change the style of these objects by the condition data-id=9 in jquery?
try as below, it is a example
HTML
<div data-id="9">Hello</div>
<div data-id="9">Hello</div>
<div data-id="9">Hello</div>
<div data-id="10">Hello</div>
JS
$('div[data-id="9"]').addClass("hi");