Lable hidden 隱藏 取值 給值
make hidden
document.getElementById('<%= lbl.ClientID%>').style.visibility = "hidden";
make visible
document.getElementById('<%= lbl.ClientID%>').style.visibility = "visible";
取值:var Label_text=document.getElementById('test_label').innerHTML;
給值:document.getElementById('test_label').innerHTML = ids;
這樣也抓值可以
document.getElementById("<%=txtPatNo.ClientID %>").value = str_value;
if (document.getElementById("<%=lblMsg.ClientID %>").innerText == "請輸入xxx"){
document.getElementById("<%=btnQuery.ClientID %>").onclick();}
如果是前台的值要讓後台使用,Lable這樣抓不到,要改用
<input type="hidden" id="abc" runat='server' />
給值後
document.getElementById("ContentPlaceHolder1_abc").value = document.getElementById('ContentPlaceHolder1_FileUpload1').value;
後台就能抓abc.Value;
沒有留言:
張貼留言