html中input文字框,初始里边有文字提示。当点选时,文字消失,怎么改?

html-css06

html中input文字框,初始里边有文字提示。当点选时,文字消失,怎么改?,第1张

中input文字框,初始里边有文字提示。当点选时,文字消失,怎么改? 使用onfocus事件检查当前值,如果是预设值,就将value属性置空.如:

<input type=text value="请输入内容" onfocus="javascript:if(this.value=='请输入内容')this.value=''">

单纯的文字框:(通常用使用者名称之类的)

<input type=text name=username id="username" class="page_speeder_50439328" value="请输入您的帐号" onFocus="if(value=='请输入您的帐号') {value=''}" onBlur="if(value==''){value='请输入您的帐号'}">

密码状态时 中上面的方法会显示不出字 而是预设的星号或者点 所以用下面的实现

密码框预设有字 滑鼠点选后预设字消失

<!DOCTYPE PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN"

":w3./TR/x1/DTD/x1-strict.dtd">

<>

<head>

<meta -equiv="Content-Type" content="text/charset=utf-8">

<title>无标题文件</title>

</head>

<style type=text/css>

#inputs{width:300pxmargin:50px autoborder:solid 1px #090}

#password{display:none}

</style>

<body>

<div id="inputs">

<input id="password" type=password />

<input id="password_text" type=text value="请输入密码" />

</div>

<script type=text/javascript>

window.onload=function(){

var pwd = document.getElementByIdx_x("password")

var pwd_text = document.getElementByIdx_x("password_text")

pwd_text.onfocus = function(){

pwd.style.display = "inline"

pwd_text.style.display = "none"

pwd.focus()

}

pwd.onblur=function(){

if(pwd.value==null || pwd.value=="" || pwd.value=="请输入密码"){

pwd.style.display="none"

pwd_text.style.display="inline"

}

}

}

</script>

</body>

</>

Axure 文字框获取焦点【提示文字不消失】,打字之后提示文字才会消失

用单行文字框,设定提示文字就可以了。

看看这个对你有帮助:tieba.baidu./p/3830575277?fr=frs

滑鼠点选文字框内文字就消失 Input属性怎么写

<form>

<input type=text value="点这里" onclick="this.value=''focus()">

</form>

点选输入文字框,预设文字消失?用js怎样实现啊?求程式码!<input type=text placeholder="请输入文字"><!-- 新增placeholder不需要js控制 --><input id='keyword' name='keyword' type=text><!-- 这里可以用js控制 --><script> var keyword = document.getElementById('keyword')if (!keyword.value) {keyword.style='color: #999'keyword.value = '请输入文字'}keyword.onfocus = function(e) {if (!e.target.value || (e.target.value === "请输入文字")) {keyword.removeAttribute('style')keyword.value = ''}}keyword.onblur = function(e) {if (!e.target.value || (e.target.value === "请输入文字")) {keyword.style='color: #999'keyword.value = '请输入文字'}}</script> 文字框提示文字,该怎么解决

两种方法解决:

1、前台解决:在点选提交按钮时先把该文字框设为空即可:

<input type=submit value="提交" onclick="if(username.value==username.defaultValue) username.value=''">

2、后台解决:就是后台检测到该文字框提交的资料为“请输入您的使用者名称或手机号码”时就按使用者未输入来处理。这个方法其实更简单。

在文字框失去焦点后 在文字框后面出现文字提示 用jquery怎么写

:

<input type=text /><span></span>

jquery:

$("input").blur(function(){

$(this).next("span").("提示资讯");

})

(vb)怎么让执行时文字框中显示文字,但是一点,文字消失,让你打字?

Private Sub Form_Load()

Text1.Text = "请输入账号"

End SubPrivate Sub Text1_Click()

Text1.Text = ""

End Sub

试试呢

office publisher 2003里的文字框怎么改文字方向?

选中文字右键,字型,里面有方向选择。

word文字框只要一拉小,文字框里文字就消失这样该怎么办啊

选中文字框-设定文字款框格式-文字框-内部边距(设为0)试试。如线条不想要颜色,线条颜色可选无。

流程图中的文字框里的文字怎么消失了?

不是你的问题,是OFFICE本身的问题,很多人都遇到过,只能重新调整一下显示出来,偶然性的

需要准备的材料分别有:电脑、chrome浏览器、html编辑器。

1、首先打开html编辑器,新建一个html文件,例如:index.html。

2、在index.html中的<body>标签中,输入以下html代码:

<input type="text" placeholder="请输入账号" />

<input type="password" placeholder="请输入密码" />

3、浏览器运行index.html页面,此时的输入框有了提示文字“请输入账号”,密码框有了提示文字“请输入密码”。