Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Young Matrix Lookup </title>
<body>
<script language= "JavaScript" >
function Xunhuan ()
{
var m = parseint (document.getElementsByTagName ("input") [0].value) | | document.getElementsByTagName ("input") [0].getattribute ("value");
var n = parseint (document.getelementsbytagname ("input") [1].value) | | document.getElementsByTagName ("input") [1].getattribute ("value");
var t = parseint (document.getElementsByTagName ("input") [2].value) | | document.getElementsByTagName ("input") [2].getattribute ("value");
if (M >= 1&&n <= 1000&&t >= 1&&t <= 1000000)
{
var num = 2;
for (var x = 0;x < m;x++)
{
for (var y = 0;y < n;y++)
{
document.write ((num++) + "");
}
document.write ("<br/>");
}
var a=new Array ();
for (var e = m*n+1;e > 1; e--)
{
A.splice (0,0,e)
}
Chazhao (a,t);
}
Else
{
Alert ("Do not meet the requirements, please re-enter");
}
}
function Chazhao (a,number)
{
document.write (Iscon (A, number));
function Iscon (A, number)
{
for (var i=0; i<a.length; i++)
{
if (a[i] = = number)
{
Return String (TRUE);
}
}
return String (FALSE);
}
}
</script>
<form>
<p> matrix number of rows: <input type= "text" name= "Matrix rows" value=3/> Matrix columns: <input type= "text" name= "matrix number" value=3/></ P>
<p> Query number: <input type= "text" name= "query number" value=1/></p>
<input type= "button" onclick= "Xunhuan ()" value= "Array"/>
</form>
</body>