JQuery is not working in php while loop

ID must be unique across the whole page.

If you generate multiple rows in your table, you’ll have a cell with id="tags" in each row (i.e. not unique within the page). JQuery won’t be able to find the other cells due to this.

If you want more cells to share something you can find with JQuery’s selector, use class attribute instead of id and .tags instead of #tags.

Leave a Comment