Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
Laravel Livewire change Jquery class name inside component

Here i have a component which i want to change jquery class/id name, all of my jquery codes into <script> tag don't update after change class/id names

for example:

class OrderFormComponent extends Component
{
    public string $current_span = '';

    public function render()
    {
        return view('livewire.front.order-form-component');
    }
}

view:

    @push('scripts')
        <script>
            $("{{$current_span}}").removeClass("active-process");
            

            $("#section-2").on("click", ".next-level-2", function (e) {
               @this.set('current_span', '#pstep-1>span');
            });
        </script>
    @endpush
</div>

here i want to change current_span variable to #pstep-1>span by clicking on #section-2 and use that in $("{{$current_span}}").removeClass("active-process");

when i put $("{{$current_span}}").removeClass("active-process"); outside of script it work fine

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!