猿问

想做一个修改文本框的值,方向思路有些混乱啊,带效果图 应该怎么写呢

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

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

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

<style>

div{ width:569px; height:33px; border: solid 1px #000000;}

#box{ background:#0F9; line-height:30px;}

.box1{ display:none};

</style>

<script>

window.onload = function(){

var oDiv = document.getElementsByTagName('div');

}

function fn1(){

var aBtn = oDiv.getElementsByTagName('input');

var oSpan = oDiv.getElementsByTagName('span')[0];

var abox = oDiv.getElementsByClassName('box1')[0];

var txt = oSpan.innerHTML;

aBtn[0].onclick = function (){

 

}

}

</script>

</head>


<body>

<div id="box">分类名称</div>

<div><span>妙味远程课堂<input type="text" class="box1" /></span><input type="button" value="修改" /></div>

<div><span>妙味远程课堂<input type="text" class="box1" /></span><input type="button" value="修改" /></div>

</body>

</html>

图像789
浏览 1167回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答