its possible style the attribute data? for example i have this code
<div data-visual-id="1">
bla bla bla
</div>
and i have only this code for add a style "display:none" obviously the div can not hide it otherwise hide other parts of the site
its possible style the attribute data? for example i have this code
<div data-visual-id="1">
bla bla bla
</div>
and i have only this code for add a style "display:none" obviously the div can not hide it otherwise hide other parts of the site
You can use attribute-selector to get it done. Check this link for more reference. Check below snippet.
div[data-visual-id="1"] {
color: red;
}
<div data-visual-id="1">
bla bla bla
</div>
Ah but of course it's possible, your CSS selector would look something like this
div[data-visual-id="1"] {
display: none;
}
<div data-visual-id="1">
bla bla bla
</div>
You can do it simly this way:
$('*[data-visual-id="1"]').css({'display': 'none'});
For more information, go to this link Selecting element by data attribute.