Bonjour,
Dans mon exemple j'essaye d'afficher une boite d'alerte pour tous les elements title sauf celui comprenant hello sans y arriver... si quelqu'un pouvait m'éclairer....
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 <div id="div1"> <p title="hello">Paragraphe 1</p> <p>Paragraphe 2</p> <p id="p3">Paragraphe 3</p> <p title="coucou">Paragraphe 4</p> <p>Paragraphe 5</p> <p>Paragraphe 6</p> </div> <div> <a href="#">Paragraphe 4</a> <a href="#">Paragraphe 4</a> <a href="#">Paragraphe 4</a> </div> <script type="text/javascript"> $("p").each(function(index) { if(this.index != "hello") alert($(this).attr("title")); }); </script>
Merci d'avance pour vos réponses....
Partager