Reputation: 855
I think I made a small typo or something like that, because something clearly doesn't work as it should. I want to change the ID's of two different divs, in a sequence.
setTimeout(function() {$("#t1").attr('id','t1out')}, 4000)});
setTimeout(function() {$("#t2").attr('id','t1')}, 4500)});
Somehow, this manages to mess up the entire javascript, so nothing runs at all.
Any idea what went wrong?
Upvotes: 0
Views: 229
Reputation: 388316
There are syntactical problems in the script . There is an extra }
at the end of each statements.
setTimeout(function() {
console.log('1')
$("#t1").attr('id', 't1out')
}, 4000);
setTimeout(function() {
console.log('2')
$("#t2").attr('id', 't1')
}, 4500);
Demo: Fiddle
Upvotes: 2