Run JavaScript code after the page loads
Hi,
I'm using the latest version of Filament. In my project, I need to run a JavaScript code (variable) in Blade when a button is clicked. I will use it as simply as in the codes below. How can I make it work?
After clicking the button, the JavaScript code appears within the HTML code, but it doesn’t run because it’s loaded afterward.
3 Replies
run it after the page loads or when a button is clicked ?
it should work after clicking the button
Either use plain JS or Alpine.
onclick="doThings()