【IT168技术文档】
用value取Label的值总是取不到,说是undefined,请教了下其他人,原来是用innerHTML
value 与 innerHTML
取文本框textbox的值用value,label的值用innerHTML
textbox示例:
label示例:var ddl = document.getElementById("ddlType"); var tid = ddl.options[ddl.selectedIndex].value; var key = document.getElementById("txtKey").value; window.location.href="aa.aspx?Key="+escape(key)+"&tid="+tid+"";
var companycode = document.getElementById("LblcompanyCode").innerHTML; window.showModalDialog("aa.aspx? code="+companycode,"","dialogHeight:300px;dialogWidth:400px;status:off;scroll:off;"); window.location.href = window.location.href;