Dumb question. I am trying to get a message to appear and dissapear after a couple of seconds. I just thought I would have a timeout function and at the end I would just append an empty string.
setTimeout(function() {
$('#resultDivSE').append('<b><p style="font:color:rgb(128,0,128)">' + data + '</p></b>');
}, 1000)
$('#resultDivSE').append('');
That doesn’t appear to be working. Am I missing something here… Also, How would you set the color of the text?
Your logic is backwards. You need to set the message right away and then, in the timeout, clear it. To make a message appear for a second, you would do this:
P.S. I’ve also filled in the proper style value for settings the color of the text.
P.P.S One second is not a very long time for a message to display. You probably want something like 5 seconds.