怎样在一个文本框中输入内容,当光标从上面移除的时候能在文本域中显示出来这个内容!
展开全部
由于机器没装编辑软件,规格你自己调好,我只做了模型
=============================================================
<script>
function hid()
{
var myAlert = document.getElementById("alert");
myAlert.style.display = "none";
}
function onsub(name)
{
// mClose.onclick();
hid();
document.getElementById("new_one").value=name.innerText;
}
function new_hid()
{
hid();
}
</script>
验证码:<span id="content"><input id="new_one" type="text" size="2" maxlength="4" /></span><div id="alert" style="display:none"><img src="" title="换一个" alt="换一个" class="valicode" onclick="this.src=''" />
</div>
<input type="submit" class="cur" value="提交留言" />
<div style="width:100%;height:100%;" onclick="new_hid();"></div>
<script type="text/javascript">
var myAlert = document.getElementById("alert");
var reg = document.getElementById("new_one");
var mClose = document.getElementById("close");
reg.onclick = function()
{
myAlert.style.display = "block";
myAlert.style.top=event.clientY;
myAlert.style.left=event.clientX;
}
mClose.onclick = function()
{
myAlert.style.display = "none";
}
</script>
=============================================================
<script>
function hid()
{
var myAlert = document.getElementById("alert");
myAlert.style.display = "none";
}
function onsub(name)
{
// mClose.onclick();
hid();
document.getElementById("new_one").value=name.innerText;
}
function new_hid()
{
hid();
}
</script>
验证码:<span id="content"><input id="new_one" type="text" size="2" maxlength="4" /></span><div id="alert" style="display:none"><img src="" title="换一个" alt="换一个" class="valicode" onclick="this.src=''" />
</div>
<input type="submit" class="cur" value="提交留言" />
<div style="width:100%;height:100%;" onclick="new_hid();"></div>
<script type="text/javascript">
var myAlert = document.getElementById("alert");
var reg = document.getElementById("new_one");
var mClose = document.getElementById("close");
reg.onclick = function()
{
myAlert.style.display = "block";
myAlert.style.top=event.clientY;
myAlert.style.left=event.clientX;
}
mClose.onclick = function()
{
myAlert.style.display = "none";
}
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询