function check(v)
{
if(v.match(/^\d+$/)) return true
else {
alert("输入必须全是数字")
return false
}
}
</script>
<form>
<input type="text" name="txt" />
<input type="submit" onclick="return check(this.form.txt.value)" />
</form>
function abc(){var patt1=new RegExp("e")
var sd=(patt1.test("The best things in life are free"))
var obj=document.getElementById("td")
document.getElementById("td").value=sd
alert(obj)
}