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

143
Views
How to call a Javascript function in an attribute of an element

I'm working in laravel php and have blade.php views,

I have the following component which is used in blade.php as follows

<x-form.select
            wire:model.defer="state.trip_destination"
            :search="true"
            x-search="
                (query) => {
                    return new Promise((resolve, reject) => {
                        resolve(fun()); //HERE
                    });
                }
            "
            name="state.trip_destination"
            type="text"
            id="trip-destination"
        />

Now I want to call the function fun() which is just returning a string, and is defined as

<script>
function fun()
{
    return "HELEL";
    debugger;
};
</script>

It doesn't goes to that function because it is out of scope, is there any way to solve this problem.

Thanks,

about 4 years ago · Juan Pablo Isaza
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!