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

219
Views
Can't hide element when empty
<div id="url" class="infoline">
  <i class="fa fa-link fa-2x fa-fw coloriconfa"></i>
  <a href="<?=$data['post']['url']?>" target="_blank"><?=$data['post']['url']?></a>                     
</div>

Hide searches with this function JS

$(document).ready(function() {
$("#url").each(function() {

    if($.trim($(this).html()).length == '') {
       $(this).hide();
    };
 });
});

Help me please

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

A friend @Phix suggested a solution and it worked!

<div id="url" class="infoline">
  <i class="fa fa-link fa-2x fa-fw coloriconfa"></i>
  <a id="ur" href="<?=$data['post']['url']?>" target="_blank"><?=$data['post']['url']?></a>                     
</div>

Tweaked

$(document).ready(function() {


    if($.trim($(ur).html()).length == 0) {
       $(url).hide();
    };
});

I had to add an id for line a, but this is tolerable)

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