MDanz Posted May 22, 2010 Share Posted May 22, 2010 i have two id's that are the same from two different table. var newtext = document.getElementById(number).innerHTML; this code is grabbing the wrong id. the id is a counter/variable in a loop so it changes, so i can't do getElementByName.. how do i get around this? Link to comment https://forums.phpfreaks.com/topic/202579-getelementbyid-duplicate-id-problem/ Share on other sites More sharing options...
Mchl Posted May 22, 2010 Share Posted May 22, 2010 id should be unique withina document. You're breaking the rules, you get consequences. Link to comment https://forums.phpfreaks.com/topic/202579-getelementbyid-duplicate-id-problem/#findComment-1062021 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.