0

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

Exolon
  • 11
  • 5

3 Answers3

1

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>
RaJesh RiJo
  • 4,302
  • 4
  • 25
  • 46
0

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>
Claudiordgz
  • 3,023
  • 1
  • 21
  • 48
0

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.

juntapao
  • 407
  • 3
  • 12