Your code stops working because of a syntax error in
SetTimeout function(){
Correct it to
setTimeout(function() {...}, 5000);
Btw. getElementById()
does not need the # hash before the id string. It even won’t work with the #
More Related Contents:
- Dynamically adding div on button click and changing Id of each?
- How to make page loaders/animations/transitions
- Get specific text from html tag jquery [duplicate]
- How to change the image while sharing the content to the social networks? [duplicate]
- How to take screenshot of a div with JavaScript?
- How to scroll an HTML page to a given anchor
- How to detect Ctrl+V, Ctrl+C using JavaScript?
- How to show Page Loading div until the page has finished loading?
- How to reload current page without losing any form data?
- Jquery load() only working in firefox?
- How do I add an “Add to Favorites” button or link on my website?
- Play an audio file using jQuery when a button is clicked
- Dynamically loading css stylesheet doesn’t work on IE
- How to close an open collapsed navbar when clicking outside of the navbar element in Bootstrap 3?
- How can I detect whether an iframe is loaded?
- Drop-down box dependent on the option selected in another drop-down box
- Getting Bootstrap’s modal content from another page
- Can I use javascript to dynamically change a video’s source?
- Sort an html list with javascript
- Run change event for select even when same option is reselected
- JQuery Slider, how to make “step” size change
- HTML 5 – Play file at certain time point
- How to move table row in jQuery?
- Bootstrap 4 multiselect dropdown
- Best way to execute js only on specific page
- How to enable Bootstrap tooltip on disabled button?
- jQuery: Slide left and slide right
- JavaScript: get code to run every minute
- jQuery animated number counter from zero to value
- Setting new value for an attribute using jQuery