If i have elements such as this
If you've inherited code so horrible that you can only work with the faulty output, use jQuery("[id=theidthatshouldbeaclassinstead]") or jQuery("[id*=theidthatshouldbeaclassinstead]") if there are multiple ids for some reason.
jQuery("[id=theidthatshouldbeaclassinstead]")
jQuery("[id*=theidthatshouldbeaclassinstead]")