The first part to work: setTimeout
wants the instruction going to be executed, to be wrapped in quotes, single or double as well as alert
requires for its string-message; so, the correction by swordz
would be enough, if JS/HTML alone.
He alternates ' and " quotes, they not to interfere: You can't do setTimeout('alert('testing!!');',3000); nor with repeating " (JS gets blocked!); this is right, as for JS:setTimeout("alert('testing!!');",3000);
BUT, since PHP echo introduces string by quotes itself, interference would occur again.
We can use backslash as escape character
in place; this works: