|
|
|
|
для: vladimer
(02.09.2005 в 01:02)
|
| Ловите универсальную функцию:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Table Borders</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript">
function findWord(string){
// example of searching word
var word = "World";
//
if (string.indexOf(word) > 0) {
alert("The word: " + word + " in this string was found!");
} else {
alert("not found!");
}
}
</script>
</head>
<body>
<form action="" method="post" name="form1">
<input type="text" name="my_string" value="Hello World !" />
<input type="button" onclick="findWord(document.forms.form1.my_string.value)" value="Find">
</form>
</body>
</html>
|
Если надо, подстроите под себя. | |
|
|