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

233
Views
Fire click event once per (different) class

I'm trying to have a click event fire on any tag with the same class only once.

I tried using '.one', although, it removes itself after the first class tag is clicked.

$(document).ready(function() {   
    $(".dropdown").one('click', function() { 
        ...
    });
});

The code is bought in from another .php file on the same directory with some server information so there are multiple (no end) in the number of tags with the same class.

<div class = \"dropdown\" id=" . $row["name"] . "dropdown" . ">
                    <div>". $row["email"] . "</div>
                    <div>name:" . $row["name"] ."</div>
                    <div>". $row["email"] ."</div></div>
                    ";

Any recommendations?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

As per your comments what you actually needs to do is apply a check of text available already or not?

$(document).ready(function() {   
    $(".dropdown").on('click', function() { 
       if(empty($('<text wrapper class or id>').text())){
           // add code to bring the info
       }
       //rest other code.
    });
});

Note : I fyou can show your code HTML then I can Update my code to give you concreete answer. The above will guide you how to proceed.

over 4 years ago · Santiago Trujillo Report
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!