如果文本框不为空,如何显示按钮? [英] How to show button if textbox is not empty ?
本文介绍了如果文本框不为空,如何显示按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果文本框不为空,我想显示一个按钮。
我尝试了什么:
否则清空文本框值,然后隐藏按钮,就像在jQuery中切换一样。我怎样才能做到这一点?这里是小提琴......
[ ^ ]
I want to show a button if the text box is not empty.
What I have tried:
Otherwise empty the textbox value, then hide button like toggle in jQuery. How can I do this? here is fiddle...
[^]
推荐答案
也许下面的函数可以工作,
Perhaps the following function would work,
( #txtBoxClientId)。change( function (){ // 您的keyup功能也正确
if (
("#txtBoxClientId").change(function () { // Your keyup function was also correct if(
( this )。val() == ){
// 如果文字为空,
(this).val() == "") { // If text is empty,
这篇关于如果文本框不为空,如何显示按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文