I have a few div and i want to hide them with js. But my script just hides one of them. How can I hide all of them?
function hide(id) {
document.getElementById(id).style.display = "none";
}
hide("test");
<div id="test" data-studio="disney" data-month="mar" data-action="action" data-serie="serie" data-platform="disney+" class="product">Dinner</div>
<div id="test" data-category="first meal" class="product">First meal</div>
<div id="test" data-category="garnish" class="product">Garnish</div>
And how can I just hide elements with the data-category garnish?