I didn't look much into the context, but seems like we should var the variable properly instead of changing the element ID.