Texte séléctionné

ayarikhaoula Messages postés 126 Date d'inscription vendredi 13 août 2010 Statut Membre Dernière intervention 15 août 2011 - 18 déc. 2010 à 11:17
@karamel Messages postés 1855 Date d'inscription vendredi 9 mai 2008 Statut Modérateur Dernière intervention 18 avril 2024 - 18 déc. 2010 à 13:10
salut tout le monde.
est ce qu'on peut lancer un script d'odre générale qui détecte le texte sélectionné sur n'importe quelle page web chez le client.merci d'avance.

1 réponse

@karamel Messages postés 1855 Date d'inscription vendredi 9 mai 2008 Statut Modérateur Dernière intervention 18 avril 2024 153
18 déc. 2010 à 13:10
essai avec ce script


<html>
<head>
<title></title>
<script>

function selectexte(lui){
var texte=window.getSelection ? window.getSelection().toString() : document.selection.createRange().text;

alert(texte)
}
</script>
</head>



ggggghhhhhhhhhhhhhhkkkkkkkkkkkkkkkkkk

yyyyyyyyyyyyyooooooooooooooooorrrrrrrrrrrrr

yyhhhhhhhhhhhhhhhhookkkkkkkkkkkkkooooorrrl



coucou

</html>
0
Rejoignez-nous