点击input框后自动复制input框中的内容

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<script>
function oCopy(obj){
obj.select();
js=obj.createTextRange();
js.execCommand("Copy")
}
</script>
<input type="text" value="http://www.souab.com/post-178.html" onclick="oCopy(this)" style="border:1px #cccccc solid;width:300px;">
</body>
</html>

post by 不懂戀愛魚兒 | 2011年5月2日 | 归档于 [Asp技术]
标签: function input

Input录入控制,只能输入数字(JS代码,FF IE)

<input onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">

简单的正则 \d 只能输入数字     replace 字符替换

post by 不懂戀愛魚兒 | 2010年7月18日 | 归档于 [网站特效]
标签: js input
sitemap