It seems the jQuery leave the content of the old tab there. When switching between different tabs that containing HTML with the same ID, there will be duplicated IDs, thus selecting elements with ID will get the wrong element (in other invisible tab).
It seems the jQuery leave the content of the old tab there. When switching between different tabs that containing HTML with the same ID, there will be duplicated IDs, thus selecting elements with ID will get the wrong element (in other invisible tab).