Home » Jquery » jquery – cant get $this to actually hide content of its only

jquery – cant get $this to actually hide content of its only

Posted by: admin February 22, 2020 Leave a comment

Questions:

I have 3 blocks with div class =”body.eventos .detalle-evento .combinaciones .combinacion”, within this there are prices info with more clases and 1 of them is equal to “0” the others can vary in dependency i need to hide entire div (“body.eventos .detalle-evento .combinaciones .combinacion”) when price is equal to 0

$("body.eventos .detalle-evento .combinaciones .combinacion").each(function() {
 var test =  $('body.eventos .detalle-evento .combinaciones .combinacion .detalles .precio p:contains(desde.00USD)');
if (test.length > 0) {
$(this).hide();

}
});

but it keeps hiding all even if the others have prices not equal to 0

do not have access to the html file.

this is how the css looks like

<div class="combinaciones">

 <div class="tipo col-lg-12 col-md-12 col-sm-12 col-xs-12" data-posicion="1">
 <div class="combinacion">
  <div class="detalles">
    <p class="sup">¡Agrégale tu estadía a las entradas!</p>
        <h4><br xmlns="http://www.w3.org/1999/xhtml">
   Entrada + Alojamiento (con opción de Vuelos)</h4>
    <p>° 5 noches en el Hotel Catalonia 
<br xmlns="http://www.w3.org/1999/xhtml">
° Disfruta de una Cena en el Restaurante 
<br xmlns="http://www.w3.org/1999/xhtml">
° Posibilidad de reservar tu vuelo ida y vuelta, </p>

        <div class="precio">

      <p><span>desde</span>687.50<sup>USD</sup></p>
    </div>
 </div>




 <div class="tipo col-lg-12 col-md-12 col-sm-12 col-xs-12" data-posicion="2">
  <div class="combinacion">
  <div class="detalles">
    <p class="sup"><span class="entrance-only" xmlns="http://www.w3.org/1999/xhtml">Disfruta de una cena en el Restaurante </span></p>

        <p></p><div class="texto" xmlns="http://www.w3.org/1999/xhtml"><p>¡Vamos a disfrutar de la Cena!</p></div><p></p>

    <div class="precio">

      <p><span>desde</span>.00<sup>USD</sup></p>
    </div>
    </div>
How to&Answer: