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>
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();
Correct solution on the second floor. id is unique. Just change it to class selector