1

Estoy intentando ocultar un span con el atributo title="Planificación" de la siguiente manera, pero no funciona y no me da error en consola

$("span").find(`[title='Planificación']`).hide();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<span title="Planificación">Planificación</span>

2 respuestas 2

3

La función find de jQuery funciona para buscar hijos debajo del elemento desde el cual se ejecuta esta función jQuery FIND. En tu caso, el elemento SPAN no tiene hijos con esa propiedad. Para lograr tu objetivo, debes buscar elementos SPAN con la propiedad title, que tenga el valor deseado. Ejemplo:

$("span[title='Planificación']").hide();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<span title="Planificación">Planificación</span>

2

Prueba con

$("span[title='Planificación']").hide();

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.