jQuery hide all elements with the same id

前端 未结 3 1293
忘掉有多难
忘掉有多难 2021-01-04 00:35

by topic I have some divs with id = \"loader\".

In my jQuery code I have

  $(\"#loader\").hide(),

but it works only with the first

3条回答
  •  春和景丽
    2021-01-04 01:27

    A way to hide all items of the same ID was as follows

    $( "#hide" ).click(function() {
      $('div#hidden').hide();
    });
    ID Number 1
    ID Number 2
    ID Number 1
    ID Number 2
    ID Number 1
    Hide Div

    Hope you can find this helpful.

提交回复
热议问题