Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select name="lacouleur" id="lacouleur" size="1" onchange="CouleurText()">
- <option value="black" class="noir" selected="selected">Choisisez la couleur du Texte</option>
- <option value="red" class="rouge" value="01">noir</option>
- <option value="red" class="rouge" value="02">rouge</option>
- <option value="green" class="vert" value="03">vert</option>
- <option value="blue" class="bleu" value="04">bleu</option>
- </select>
- /////////////////////////////////////
- function CouleurText() {
- if (document.getElementById("lacouleur").selectedIndex == 1) {
- document.getElementById("paragraphe").style.color = "black";
- }
- if (document.getElementById("lacouleur").selectedIndex == 2) {
- document.getElementById("paragraphe").style.color = "red";
- }
- if (document.getElementById("lacouleur").selectedIndex == 3) {
- document.getElementById("paragraphe").style.color = "green";
- }
- if (document.getElementById("lacouleur").selectedIndex == 4) {
- document.getElementById("paragraphe").style.color = "blue";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement