本文主要是介绍input text文本框预设灰色初值,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>新建网页 1</title>
- </head>
- <body>
- <form name="form0" onsubmit="if (this.txt.value=='预设值是灰色'){this.txt.value='';alert('txt.value='+this.txt.value);}">
- txt:<input id="txt" name="txt" type="text" value="预设值是灰色" style="color:#ddd" onfocus="if (this.value=='预设值是灰色')this.value=''" onblur="if (this.value=='')this.value='预设值是灰色'">
- <input type="submit" value="OK"></form>
- </body>
- </html>
easyUI中设置
//combobox不可编辑
<script type="text/javascript">
$(function(){
$('#cc').combobox({
required:true,
multiple:true,
disabled:true,
editable:flase
});
});
</script>
这篇关于input text文本框预设灰色初值的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!