1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Search</title>
</head>
<body>
<div style="height: 70px">
<input type="text" id="findField" value="" placeholder="Tapez ici le mot à chercher..." size="30" />
<button onclick="search();">Find !</button>
</div>
<div style="height: 700px">
<iframe name="myFrame" id="myFrame" width="100%" height="100%" src="html.html" /></iframe>
</div>
<script>
function search() {
var frame = document.getElementById('myFrame');
var word = document.getElementById("findField").value;
if (word == "") {
alert("Entrez un mot !");
return;
}
if (frame.contentWindow.find(word)) alert("Trouvé !");
else alert("Non trouvé !");
}
</script>
</body>
</html> |