using jQuery I would like to change the ID one of element within a page, a div, and give it a new one. I cannot use classes, must be ID. This will be part of an IF statement, for example: (pseudo:)
if x = greater than 1, change id of x to y else do nothing
So far I have:
$('#carriage-promo').attr('id','#carriage-promo-2');
However, this doesn't seem to work. Any suggestions?
I've never worked with ID, always class, and I would have used addClass and removeClass, which have always worked for me in the past!