<
input
type
="text"
name
="mytext"
id
="mytext"
/>
< input type ="button" value ="click" onclick ="Check();" />
< script language ="javascript" >
function Check()
{
var re = new RegExp( " /.(gif|jpg)$/i " , "" );
var myvalue = document.getElementById( " mytext " ).value;
var mresult = re.exec(myvalue);
if ( mresult != null )
{
// alert("找到的:" + mresult);
document.write(mresult);
}
}
</ script >
< input type ="button" value ="click" onclick ="Check();" />
< script language ="javascript" >
function Check()
{
var re = new RegExp( " /.(gif|jpg)$/i " , "" );
var myvalue = document.getElementById( " mytext " ).value;
var mresult = re.exec(myvalue);
if ( mresult != null )
{
// alert("找到的:" + mresult);
document.write(mresult);
}
}
</ script >