thinkphp3.2.3+jquery hidden problems
某草草
某草草 2017-05-16 13:10:09
0
3
486

Traversed out

< /p>

Then I wanted to use jquery to hide all the traversed things.
I used this jquery code

< /p>

I don’t know why only one is hidden? Aren't all traversed items hidden?

某草草
某草草

reply all(3)
習慣沉默

According to the specification, the id is unique in a page. If you generate multiple elements with the same ID in the page, this itself violates the specification. jQuery's id selector instinctively thinks that there can only be one element, so the situation in the problem description occurs!
Please set the class attribute. Elements that need to have the same performance use the same class name, and then operate the class name to control multiple elements at the same time.
HTML
<td class='num'></td><td class='num'></td>

Javascript
$('.num').hide();

phpcn_u1582
$('[id="num1"]').hide()
过去多啦不再A梦

Correct solution on the second floor. id is unique. Just change it to class selector

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template