Title: Creating timer with javascript
Last modified: August 30, 2025

---

# Creating timer with javascript

 *  Resolved [bernard57](https://wordpress.org/support/users/bernard57/)
 * (@bernard57)
 * [9 months ago](https://wordpress.org/support/topic/creating-timer-with-javascript/)
 * This is my requirement:
   I want to add a button in elementor that when clicked
   starts a 15 second timer that continues even when I navigate to other pages. 
   The button should click when activated and sound played when timer ends. Where
   do I put html and where do I put javascript?
 * I have tried various ai suggestions but just can’t get things to work properly.
   I am still a novice in javascript.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcreating-timer-with-javascript%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [9 months ago](https://wordpress.org/support/topic/creating-timer-with-javascript/#post-18620416)
 * Since you are using Elementor, you can use their HTML widget for this. See: [https://elementor.com/help/html-widget/](https://elementor.com/help/html-widget/)
 * Alternatively, you can also store custom code snippets in Elementor Pro: [https://elementor.com/help/custom-code-pro/](https://elementor.com/help/custom-code-pro/)
 * If you have any questions about Elementor, I would recommend their support forum:
   [https://wordpress.org/support/plugin/elementor/](https://wordpress.org/support/plugin/elementor/)
 * Apart from Elementor, you can also insert individual code into the functions.
   php of a child theme through individual programming. See: [https://developer.wordpress.org/themes/advanced-topics/child-themes/](https://developer.wordpress.org/themes/advanced-topics/child-themes/)–
   Or via the Code Snippet plugin: [https://wordpress.org/plugins/code-snippets/](https://wordpress.org/plugins/code-snippets/)
 * You can also write your own plugin to add code to your project. See: [https://developer.wordpress.org/plugins/](https://developer.wordpress.org/plugins/)
 *  Thread Starter [bernard57](https://wordpress.org/support/users/bernard57/)
 * (@bernard57)
 * [8 months, 2 weeks ago](https://wordpress.org/support/topic/creating-timer-with-javascript/#post-18637306)
 *  Thanks for your suggestions. I have managed to set this up putting the js in
   code snippets. However I notice that it does not work on all mobile browsers 
   not sure why not.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Creating timer with javascript’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 4 participants
 * Last reply from: [bernard57](https://wordpress.org/support/users/bernard57/)
 * Last activity: [8 months, 2 weeks ago](https://wordpress.org/support/topic/creating-timer-with-javascript/#post-18637306)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
