I have the following HTML:Prototype cacher la div qui a un lien spécifique (<a href)
<div> <a href="http://google.com"> Google </a></div>
I am using prototype library. I need to hide the div that has the link http://google.com avec elle Merci
I have the following HTML:Prototype cacher la div qui a un lien spécifique (<a href)
<div> <a href="http://google.com"> Google </a></div>
I am using prototype library. I need to hide the div that has the link http://google.com avec elle Merci
Dans Prototype:
$$('div a[href="http://google.com"]').each(function (e) { Element.hide(e.parentNode); })
Vous pouvez utiliser un CSS pour faire
<div class="hideMe"> <a href="http://google.com"> Google </a></div>
puis dans un CSS faire:..
#hideMe {
display:none;
}
est-jQuery disponible pour vous
Si, utilisez le code suivant:
$(document).ready(function() {
$('a[href=http://www.google.com]').parent('div').hide();
});
Si le parent est pas nécessairement au niveau suivant immédiat dans les DOM, utilisez .parents
à la place:
$(document).ready(function() {
$('a[href=http://www.google.com]').parents('div').hide();
});
qui pourraient affecter Cependant div
s sur un niveau encore plus élevé dans l'arbre.