Sélection des inputs dont l'attribut "name" se termine par "man" ?
Hello,
On sait tous choisir des éléments d'une page en fonction de l'attribut et en en filtrant ce dernier.
Ici on veut les inputs ayant un name qui commence par news
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| <!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.4.4.js"></script>
</head>
<body>
<input name="newsletter" />
<input name="milkman" />
<input name="newsboy" />
<script>$('input[name^="news"]').val('news here!');</script>
</body>
</html> |
Mais comment fait-on une sélection des inputs ayant un name se terminant par man ? pour continuer avec mon exemple :D