Bonjour à tous,
Je voudrais suite au script suivant :
<html>
<head>
<title>Moteur de recherche...</title>
<script language="JavaScript">
// Mise à jour et amélioration par http://www.toutjavascript.com
// D'après le script original de MHall
// Reproduction gratuite à condition de laisser ce commentaire
var nbSearch=0;
function findInPage(str) {
var txt, i, found;
if (str=="") return false;
if ((document.layers)||(window.sidebar)) {
if (!window.find(str)) {
alert("Fin de page atteinte.\n"+'"'+str+'" trouvé '+nbSearch+" fois.");
while(window.find(str, false, true)) {nbSearch++;}
}
else
nbSearch++;
if (nbSearch == 0)
alert('"'+str+'" est introuvable');
}
if (document.all) {
txt = window.document.body.createTextRange();
for (i = 0; i <= nbSearch && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
nbSearch++;
} else {
if (nbSearch > 0) {
alert("Fin de page atteinte.\n"+'"'+str+'" trouvé '+nbSearch+" fois.");
nbSearch = 0;
findInPage(str);
} else {
alert('"'+str+'" est introuvable');
}
}
}
return false;
}
</script>
</head>
<form name="search" onSubmit="return findInPage(this.motcle.value);">
<font size=3><input name="motcle" type="text" size=30 onFocus="nbSearch=0; if (this.value=='Recherche dans cette page...') {this.value=''}" value="Recherche dans cette page..."></font>
<input type="submit" value="OK">
</form>
</BODY>
</html>
qui permet de trouver un mot dans une page, capturer le texte qui se trouve à la suite de ce mot.
Exemple : si j'ai le texte suivant dans ma page
1- blablabla
2- bliblibli
3- blobloblo
si je recherche "3" je voudrais être capable de capturer le texte "blobloblo"....
Quelqu'un pourrait il m'aider pour cela ??
Merci d'avance et bonne journée
