各位大神关于javascript和web方面的问题 javascriptweb正则表达式jsp 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 获得textarea 节点后.value.length获取长度试试 关键是用户的输入内容要满足怎样的条件,其他的都是简单的判断<!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style>.test{width:400px;height:30px;margin:100px auto;}input{padding:5px 0 5px 5px;float:left; width:198px;background:none;border:solid 1px #ccc;height:20px;}.test span{float:left;font-size:12px;height:30px;line-height:30px; padding-left:10px;}.awokeW{color:red;}.awokeR{color:green;}</style><script>window.onload=function(){ var oInput=document.getElementById('username'); var oSpan=document.getElementById('awoke'); oInput.onkeyup=function() { if(/^\w{6,10}$/g.test(this.value)) { oSpan.className='awokeR'; oSpan.innerHTML='填写正确'; } else { oSpan.className='awokeW'; oSpan.innerHTML='请确保填写内容在6-10个字符'; } }}</script></head><body><div class="test"> <input type="text" id="username" name="username" /> <span class="awokeW" id="awoke"></span></div></body></html> 个人觉得在失去焦点的时候进行判断比较好,可以用onblur()事件 var re=/[\u4e00-\u9fa5]/g;alert(!re.test('中文') ? 'Y' : 'N');alert(!re.test('中文2x') ? 'Y' : 'N'); 文字滚动效果 在ifram中应用lightbox效果,无法全屏显示,只在ifram中显示,有没有解决办法? 求一AAABACAD这种类型的正则 求修正我的正则表达式!~~~~ js传值? javascript 怎样调用IE文件中的打印预览 setTimeOut()里面的函数的参数传递问题 提问:每选中/取消一个checkbox,在table里增加/减少一行 请教各位大侠,如何实现左右frame,点击当中的边框,其中一个页面cols="0,80%",在点击一下,cols="180,80%" 高手们能不能帮我改一下这段程序? 我想写一个blog,麻烦大神交我怎么写? 新手简单问题求助!!!
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.test{width:400px;height:30px;margin:100px auto;}
input{padding:5px 0 5px 5px;float:left; width:198px;background:none;border:solid 1px #ccc;height:20px;}
.test span{float:left;font-size:12px;height:30px;line-height:30px; padding-left:10px;}
.awokeW{color:red;}
.awokeR{color:green;}
</style>
<script>
window.onload=function()
{
var oInput=document.getElementById('username');
var oSpan=document.getElementById('awoke');
oInput.onkeyup=function()
{
if(/^\w{6,10}$/g.test(this.value))
{
oSpan.className='awokeR';
oSpan.innerHTML='填写正确';
}
else
{
oSpan.className='awokeW';
oSpan.innerHTML='请确保填写内容在6-10个字符';
}
}
}
</script>
</head><body>
<div class="test">
<input type="text" id="username" name="username" />
<span class="awokeW" id="awoke"></span>
</div>
</body>
</html>
alert(!re.test('中文') ? 'Y' : 'N');
alert(!re.test('中文2x') ? 'Y' : 'N');