You should note that the scripts is going to be operate only once on the initial render of the part. If you have to operate a JavaScript function later on - emit the event through the component and hear it in JavaScript as explained right here) https://laravel-livewire.com/docs/2.x/inline-scripts