Home › Forums › Support › I want to add a button with an onclick handler that runs this JavaScript This topic has 1 reply, 2 voices, and was last updated 3 years, 3 months ago by David. Viewing 2 posts - 1 through 2 (of 2 total) Author Posts February 9, 2023 at 4:11 am #2527039 wordpressuser13 This is the Javascript I want to run when I click the button: document.querySelector(“ruffle-embed, ruffle-object, ruffle-player”).enterFullscreen(); Any idea how I can do that in GeneratePress? February 9, 2023 at 5:04 am #2527078 DavidStaff Customer Support Hi there, GeneratePress has nothing to do with how you work with Javascript. You need to add your own eventListener if you want to “do something” on a button click. This article provides a good method for that: https://gomakethings.com/listening-for-click-events-with-vanilla-javascript/#the-vanilla-js-way-to-listen-for-click-events Author Posts Viewing 2 posts - 1 through 2 (of 2 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In