Show/hide tables with jQuery

前端 未结 6 1536
不思量自难忘°
不思量自难忘° 2020-12-31 14:32

I have a series of tables similar to the following html code:

6条回答
  •  温柔的废话
    2020-12-31 14:51

    You are using the same id on multiple elements. When you search by id, jQuery will only return one item (the first with that id). So your code is only acting on the first table. Use a class on the tables instead of an id.

//HEAD CONTENT 1//
......
$('.film').each(function(f) { //this function will execute for each element with the class "film" //refer to the current element during this function using "$(this)" });

提交回复
热议问题