value值要从外部变量中获取,类似于XXXX.value=name;这样。我试了好多种文本框中都只显示字符串,比如上边那句就显示name,而不显示name的具体值。。贴上关键代码,求大神解惑!
var content = "<br>" +
"位置:" + X + "," + Y + "<br>" +
"名称:" + '<input type="text" id="txt1" value="789" />' + "<br>" +
"范围:" + '<input type="text" id="txt2" value="&name" />' + "<br>" +
"类型:" + '<input type="text" id="txt3" value=&name />' + "<br>" +
"状态:" + '<input type="text" id="txt4" value="+name+" />' + "<br>" +
"备注:" + '<input type="text" id="txt5" value="" />' + "<br>" + "<br>" +
'<input type="button" onclick="" value="查看" />' + " " +
'<input type="button" onclick="set();" value="提交" />';
上面的几个value显示在文本框中都是字符,有没引号都一样
var content = "<br>" +
"位置:" + X + "," + Y + "<br>" +
"名称:" + '<input type="text" id="txt1" value="789" />' + "<br>" +
"范围:" + '<input type="text" id="txt2" value="&name" />' + "<br>" +
"类型:" + '<input type="text" id="txt3" value=&name />' + "<br>" +
"状态:" + '<input type="text" id="txt4" value="+name+" />' + "<br>" +
"备注:" + '<input type="text" id="txt5" value="" />' + "<br>" + "<br>" +
'<input type="button" onclick="" value="查看" />' + " " +
'<input type="button" onclick="set();" value="提交" />';
上面的几个value显示在文本框中都是字符,有没引号都一样
解决方案 »
- js控制表格显示问题
- 每行有对应的行号并且后面有删除按钮,点击则删除该行,并使下一行的行号变为该行的。(没分了,请大家帮帮忙吧)
- <table border=1><tr><td><div id="t">…怎么取得t的真实绝对位置,t.offsetTop的方式获取,会不计算border,并有误差。
- 菜鸟求解..为什么同一对象value属性一个有值一个没有值显示为on
- 求大神赐教:如何交换数组里两个对象的位置
- 知道的请回答
- 用子窗口刷新父窗口
- 一个小问题,答者有分!
- 有办法用js在后台将server端.doc文件下截到本地临时目录吗?
- 求一个平均展示的算法
- 运动框架出现抖动怎么解决?
- extjs没有输出显示
function openInfo(content, e)
{
var p = e.target;
var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
var infoWindow = new BMap.InfoWindow(content, opts);
map.openInfoWindow(infoWindow, point);
document.getElementById("txt1").value = name;
document.getElementById("txt2").value = num;
document.getElementById("txt3").value = type;
document.getElementById("txt4").value = status;
document.getElementById("txt5").value = re;
}
1:使用document.getElementById('title').value ="title";
2:然后将这个加载到var infoWindow = new BMap.InfoWindow(content);
3: map.openInfoWindow(infoWindow, point);
问题,infoWindow中的input控件腹部上值