如果使用Javascript按钮是可见的,如何重置文本框。实际上我无法检查按钮是否可见 [英] How To Reset Textboxes If Button Is Visible Using Javascript.Actually I Am Not Able To Check Whether Button Is Visible Or Not
本文介绍了如果使用Javascript按钮是可见的,如何重置文本框。实际上我无法检查按钮是否可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< script type = text / javascript> ;
function DoCancel(){
var txtCourierNo = document .getElementById( txtCourierNo);
var Reason = document .getElementById( txtReason)
var btnreject = document .getElementById( btnreject);
var btnCourier = document .getElementById( btnCourier);
if (btnreject.visible == true ){
Reason.value = ;
}
其他 如果(btnCourier.visible == true ){
txtCourierNo.value = ;
}
}
< / script>
解决方案
试试这个
btnCourier.style.visibility
或
(btnCourier.style.display ==none)
{
txtCourierNo.value =;
}
其他
Reason.value =;
详情此链接可以是有用的
http://stackoverflow.com/questions/7998060 / asp-net-button-visibility-using-javascript [ ^ ]
查看w3cschool引用:
http://www.w3schools.com/jsref/prop_style_visibility.asp [ ^ ]
此外,请查看jquery!易于学习,将使您的生活更轻松:-)
http://jquery.com/ [ ^ ]
祝你好运!
<script type="text/javascript">
function DoCancel() {
var txtCourierNo = document.getElementById("txtCourierNo");
var Reason = document.getElementById("txtReason")
var btnreject = document.getElementById("btnreject");
var btnCourier = document.getElementById("btnCourier");
if (btnreject.visible==true) {
Reason.value = "";
}
else if (btnCourier.visible==true) {
txtCourierNo.value = "";
}
}
</script>
解决方案
try this
btnCourier.style.visibility
or
(btnCourier.style.display == "none") { txtCourierNo.value = ""; } else Reason.value = "";
for detail this link can be usefull
http://stackoverflow.com/questions/7998060/asp-net-button-visibility-using-javascript[^]
Check out the w3cschool reference:
http://www.w3schools.com/jsref/prop_style_visibility.asp[^]
Also, check out jquery! Easy to learn and will make your life a lot easier :-)
http://jquery.com/[^]
Good luck!
这篇关于如果使用Javascript按钮是可见的,如何重置文本框。实际上我无法检查按钮是否可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文