<?php
if( isset($_GET['message']) ) {
$message = urldecode($_GET['message']);
echo "<h2 id='mydivm'>". $message . "</h2>";
?>
<script>
setTimeout( function() {
getElementById(mydivm).value='';
// the alert is working
alert("hello");
}, 5000);
</script>
<?php
}
?>
I am trying to hide the $message after 5 seconds through #mydivm
. However I can't get regular JavaScript to work or jQuery. Alert works when it is alone. I also have tinymic, but I don't think that is interfering. I have tried putting it outside the PHP
setTimeout(fade_out, 5000);
function fade_out() {
$("#mydivm").fadeOut().empty();
}