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

84
Vistas
Xpath not working to Match a Text using and retrieve the related Parent Div object to change the style in IE11

I have a requirement to change the parent Div's text color based on it's one of the child div's text, I have implemented following method to get the parent Div element using xpath(please note that I'm still on the way to change the style, Just abled to access the immediate Div object ). the code is working fine in chrome and EDGE .but it doesn't work for IE11. Can some one help me to implement a different approach for this which will work for all three browsers.

---------------- HTML structure-----------------------

<div class="table" id="finalResults" >
<div class="table_row" >
<div class="cell_wrapper">
<div class="cell"  >City</div> <div class="cell" >Destination city not found</div>
</div>
</div>
</div
```


```

---------------- javascript code-----------------------


            var xpath = "//div[starts-with(text(), 'Destination city not found')]";
            
            var matchingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
            document.getElementById("demo").innerHTML = matchingElement.innerHTML;
        })
``` 
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