I am trying to write some code that displays text, and then removes it two seconds later, however, the setTimeout() method doesn't seem to be working properly for me, the function that is called is running with no delay. Here's the code:
IDtext('IP-saved', "New IP Address saved successfully!");
setTimeout(IDtext('IP-saved', ""), 2000);
function IDtext(ID, text) {
document.getElementById(ID).innerHTML = text;
}
What am I doing wrong here?