Hiding and displaying a web element with CSS in a dart?

I would like to know how to hide and show elements in html using a dart. I was thinking about using a display: no; in CSS. But how do I change CSS values ​​or write CSS in a dart for different HTML tags?

Thanks.

+4
source share
1 answer

You can use Element.hidden to indicate whether an element affects the current state of the page.

If you want to use a style:

element.style.display = 'none';
element.style.display = '';

If you want to use CSS classes:

element.classes.add('selected');
element.classes.toggle('isOnline');
element.classes.remove('selected');
+5
source

All Articles