Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

125
Vistas
How to target child class and hide the parent one

I'm working with a third-party code and I'm quite limited in terms of filtering a list of elements.

Each of these elements has this structure:

<div class="item-preview">
   <div class="item-info">
      <div class="tag">
         <svg class="tag-public"></svg>
      </div>
   </div>
</div>

The only thing that changes is the svg class, so it's whether tag-public or tag-private. Depending on the user type that's checking the content, I'd like to hide it when it's tag-private. Something like:

if user == x_member_type
   if item-preview CONTAINS tag-private
      HIDE item-preview

Is there any way possible to target that parent div so I can work with that? I've tried with jQuery's parent, closest, etc. but I'm not getting any results.

For whatever reason, it is not working. I guess it's getting the list of elements via AJAX and displaying it and my added jQuery doesn't make any difference.

Do you have any ideas about what might be going on?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda