脚本在客户端取label的值
用value取Label的值总是取不到,说是undefined,请教了下其他人,原来是用innerHTML
value 与 innerHTML
取文本框textbox的值用value,label的值用innerHTML
textbox示例:
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+"";
label示例:
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;
value 与 innerHTML
取文本框textbox的值用value,label的值用innerHTML
textbox示例:
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+"";
label示例:
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;
浙公网安备 33010602011771号