将首字母大写的问题 function captlz(obj){ var str = obj.value; if (str!==""){ str = str.replace(/\b(\w+)\b/g, function($1){ return $1.substring(0,1).toUpperCase() + $1.substring(1); }); } alert(str);} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼上大哥,加入输入框中无效阿<input type="text" name="yourname" id="yourname" onBlur="captlz(this)" onkeyup="captlz(this)"> <script>function captlz(obj){ var str = obj.value; if (str!==""){ str = str.replace(/\b(\w+)\b/g, function($1){ return $1.substring(0,1).toUpperCase() + $1.substring(1); }); } obj.value = str;}</script><input type="text" name="yourname" id="yourname" onBlur="captlz(this)" onkeyup="captlz(this)"> JS无法调用 一排 span 都是 白色背景 点击的这个变红色 别的还原成白色 jquery 中的 .getJSON如何读取本地.js JSON数据? 请教一个在线绘图板的PHP或Javascript脚本 ext Tree如何获取没有被展开的子结点 Prototype.js的问题。 请教方法getReal()如何使用!!!! 请问vml的shape元素能不能一次画出多个线和圆弧,而且颜色不一样??? 求如何判断引用的外部JS加载完整? 求高手帮忙做一个横向加纵向混合的Jquery树状菜单 java jsp select下拉框里option定位 用JS写的很方便的一个MediaPlayer类
<script>
function captlz(obj){
var str = obj.value;
if (str!==""){
str = str.replace(/\b(\w+)\b/g, function($1){
return $1.substring(0,1).toUpperCase() + $1.substring(1);
});
}
obj.value = str;
}</script>
<input type="text" name="yourname" id="yourname" onBlur="captlz(this)" onkeyup="captlz(this)">