Souligner texte javascript
Résolu
Mary
-
resalut Messages postés 784 Date d'inscription Statut Membre Dernière intervention -
resalut Messages postés 784 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Je suis en train de travailler sur une zone de recherche. Le plus simple est que vous preniez mon code ...
Il y a beaucoup de lignes en tout mais la zone "interessante" est petite. Donc vala, en haut, il faut selectionner l'un des textes en rouge. Lorsque l'on clique dessus, il doit s'afficher en noir non souligne et les deux autres en rouge souligne. J'ai assez vite trouve comment changer de couleur mais pour les soulignements je seche un peu ... Est-ce que quelqu'un a une idee ? :/
Merci d'avance ^^
Je suis en train de travailler sur une zone de recherche. Le plus simple est que vous preniez mon code ...
<html> <head> <style type="text/css"> #round { width:800px; background-color: #f5f5f5; margin-left: auto; margin-right: auto; height: 80px; border-bottom: solid 1px #bbbbbb; border-top: solid 1px #bbbbbb; margin-top: 2px; margin-bottom: 2px; } </style> </head> <body> <script type="text/javascript"> <!-- function choose1(){ document.getElementById("1").style.color="black"; document.getElementById("2").style.color="#ca5242"; document.getElementById("3").style.color="#ca5242"; } function choose2(){ document.getElementById("1").style.color="#ca5242"; document.getElementById("2").style.color="black"; document.getElementById("3").style.color="#ca5242"; } function choose3(){ document.getElementById("1").style.color="#ca5242"; document.getElementById("2").style.color="#ca5242"; document.getElementById("3").style.color="black"; } //--> </script> <div id="round"> <!-- Partie concernee --> <span id="1" style="font-size: 14px; color: red; margin-left: 50px; color: #ca5242;" onClick="choose1()"><b>Search this site</b></span> <span id="2" style="font-size: 14px; color: red; margin-left: 25px; color: #ca5242;" onClick="choose2()"><b><u>Wiki Search</form></u></b></span> <span id="3" style="font-size: 14px; color: red; margin-left: 25px; color: #ca5242;" onClick="choose3()"><b><u>Search all history sites</form></u></b></span><br /><br /> <!-- Fin de la partie concernee --> <form action="http://boek.nuwegeskiedenis.co.za/Special:Search" name="form1"> <table><tr> <td> <span class="Apple-style-span" style="margin-left: 5px; border-collapse: separate; font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; vertical-align: center;"> <span class="Apple-style-span" style="color: #e4e4e4; font-family: Verdana; font-size: 12px; line-height: 18px; text-align: left;"> <span style="margin-left: 15px; padding: 5px 13px 5px 8px; font-size: 12px; font-style: inherit; font-weight: inherit; text-decoration: inherit; background-image: url(http://z.about.com/h/hp/srch_bg.gif); background-repeat: no-repeat; display: block; float: left; background-position: 0% 100%;"> <input name="search" type="text" style="border: 2px solid rgb(205, 205, 205); margin: 0px; padding: 0px 0px 0px 0px; vertical-align: middle; width: 300px; font-family: Verdana; font-style: normal; font-variant: normal; font-weight: normal; font-size: 13px; line-height: 1.2; font-size-adjust: none; font-stretch: normal; height: 20px;" > <input type="submit" value="FIND" style="margin-left: 5px;border-width: 0px; padding: 0px; cursor: pointer; vertical-align: middle; background-color: #c31b01; height: 25px; text-align: center; text-indent: -9999px; width: 63px; margin-bottom: 3px; background-position: 50%; color: #ffffff;" /></td> </span> </span> <td> <span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"> <span style="color: rgb(51, 51, 51); font-family: Verdana; font-size: 12px; line-height: 18px; text-align: center;"></span> <label name="searchtext" type="text" style="font-size: 10px; font-family: 'Verdana'; margin-left: 5px; color: #999999;">> Search the History site for information by typing a keyword</label> </span> </span> </td></tr></table> </span> </form> </div> </body> <html>
Il y a beaucoup de lignes en tout mais la zone "interessante" est petite. Donc vala, en haut, il faut selectionner l'un des textes en rouge. Lorsque l'on clique dessus, il doit s'afficher en noir non souligne et les deux autres en rouge souligne. J'ai assez vite trouve comment changer de couleur mais pour les soulignements je seche un peu ... Est-ce que quelqu'un a une idee ? :/
Merci d'avance ^^
A voir également:
- Souligner texte javascript
- Texte de chanson gratuit pdf - Télécharger - Vie quotidienne
- Transcription audio en texte word gratuit - Guide
- Excel cellule couleur si condition texte - Guide
- Texte barré whatsapp - Guide
- Telecharger javascript - Télécharger - Langages
13 réponses
heu c'est dans mon dernier message ca ....
5
resalut, le jeudi 9 juillet 2009 à 10:48:17
*
*
*
*
*
Document.getElementById('1').style.textDecoration = 'underline';
5
resalut, le jeudi 9 juillet 2009 à 10:48:17
*
*
*
*
*
Document.getElementById('1').style.textDecoration = 'underline';
Il suffisait d'enlever le tiret ^^
document.getElementById("1").style.textDecoration = "underline";
Merci ;)
document.getElementById("1").style.textDecoration = "underline";
Merci ;)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Non mais je ne veux pas etre desagreable hein mais ca ne marche pas ton truc, donc on pourrait peut-etre passer a autre chose ? ...