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

152
Views
Laravel AJAX create HTML DOM(tooltip) element onhover

How to create dynamically tooltip using AJAX in Laravel?

I've got table, each element of table has it own ID, stored in <div id="[numbers]" hover="tooltip(this.id);"></div>

For each element I want to "create" or display tooltip(for displaying data like name, date, etc.).

Is it possible? This is what I've got at the moment:

 // blade.view
        function test(id)
        {
            $.ajax({{ 
                type: "GET",
                data:
                {
                  id:id,
                },
                url: "{{ route('box.getData') }}",
                success: function(data){
                    alert("data");
                }
             }});
        }

Route:

Route::get('/box', 'App\Http\Controllers\BoxController@getData')->name('box.getData');

How to proceed with that in Controller?

Added controller:

public function getData(Request $request)
{
    $absence = Absence::findOrFail($request->id);

    return response()->json($absence, 200);
}
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!