var op='train';
var str='<input type="hidden" name="'+op+'" /><a href="#" onclick="openFile('+op+')" id="'+op+'Value">'+xhr.responseText+'</a><br/>';
document.getElementById(""+op+"Value1").insertAdjacentHTML("beforeEnd",str);xhr.responseText是一张图片名。
当我点击超链接图片的名字,调用openFile(p)我alert(p);是object HtmlInputElement;
我想得到 train字符串,怎么获取?另注:(p.nodeValue p.toString() p.valueOf())我都试了,得不到值。
var str='<input type="hidden" name="'+op+'" /><a href="#" onclick="openFile('+op+')" id="'+op+'Value">'+xhr.responseText+'</a><br/>';
document.getElementById(""+op+"Value1").insertAdjacentHTML("beforeEnd",str);xhr.responseText是一张图片名。
当我点击超链接图片的名字,调用openFile(p)我alert(p);是object HtmlInputElement;
我想得到 train字符串,怎么获取?另注:(p.nodeValue p.toString() p.valueOf())我都试了,得不到值。
怎么讲object HtmlInputElement 转化成传给这方法之前的"train"字符串。。