- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
1.Step(Unicode RadioButton is Checked)
TextetArea notClear 当 Unicode Radio 被选中但是 Zawgyi Radio 被选中 Textarea 清晰。
2.Step(Zawgyi RadioButton is Checked)
TextetArea notClear 当Zawgyi Radio被选中但Unicode Radio被选中时Textarea 清晰。
<label><input type="radio" name="kb" value="uni" id="unikb"/>Unicode</label>
<label><input type="radio" name="kb" value="zawgyi" id="zawgyikb"/>Zawgyi</label>
<textarea id="desp" class="form-control rows="5"></textarea>
如何使用Jquery
$("input").click(function(){
if ( $(this).val()=='uni' || $(this).val()=='zawgyi'){
$("textarea#desp").val();
}
else{
$("textarea#desp").val('');
}
}) ;
我想要这种风格
textarea 不清楚。
文本区域清晰
和
文本区域不清楚。
文本区域清晰
最佳答案
您的 else 子句错误,jsfiddle 已修复:http://jsfiddle.net/hLuk2bhx/9/现在它正在工作......(:
$("input[type='radio']").click(function(e) {
if ( $(this).val()=='uni'){
$("textarea").val('');
}else{
$("textarea").val('');
}
});
在您发表评论后,我更新了您的代码,使其更加动态,我创建了一个 var 来控制最后一条语句。
var lastChecked = undefined;
$("input[type='radio']").click(function(e) {
if ( $(this).val() != lastChecked && (typeof lastChecked !== 'undefined')){
$("textarea#desp").val('');
}
lastChecked = $(this).val();
});
希望对您的问题有所帮助。 fiddle :http://jsfiddle.net/hLuk2bhx/23/
关于javascript - 当我单击单选按钮时如何使用 ClearText textarea,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25497576/
我正在构建一个应用程序,并在我 friend 的手机上面临网络安全策略错误不允许的 CLEARTEXT 通信(我只是在另一个手机上测试它)。当然我无法追踪问题,因为应用程序在我的手机上运行正常(没有
我正在我的项目中使用 Retrofit 库,但似乎 Retrofit 会阻止非 https 请求。 我尝试添加 application Manifest.xml 中的标记 android:usesCl
我有一个特定的要求,其中我必须阻止来自应用程序的所有 http 请求,但是有一个库使用的特定 http url,我必须将其列入白名单。尝试如下设置 network_security_config xm
1.Step(Unicode RadioButton is Checked) TextetArea notClear 当 Unicode Radio 被选中但是 Zawgyi Radio 被选中 Te
我尝试执行 HttpUrlConnection,但出现了异常: java.net.UnknownServiceException: CLEARTEXT communication not su
我收到 Android 8 用户的报告,称我的应用(使用后端提要)不显示内容。经过调查,我发现 Android 8 上发生以下异常: 08-29 12:03:11.246 11285-11285/ E
我收到 Android 8 用户的报告,称我的应用(使用后端提要)不显示内容。经过调查,我发现 Android 8 上发生以下异常: 08-29 12:03:11.246 11285-11285/ E
我正在尝试通过 TCP/IP 连接到远程 MySQL 服务器。服务器需要启用 mysql-clear-password。我在 Kubuntu 16.04 上使用 RMySQL 库连接到服务器,但除了配
我收到 Android 8 用户的报告,称我的应用(使用后端提要)不显示内容。经过调查,我发现 Android 8 上发生以下异常: 08-29 12:03:11.246 11285-11285/ E
我正在尝试实现以下代码,以便从 Canvas 中删除文本。尽管它工作得很好。但我的问题是,当我单击文本时它会实现。我希望当我按下删除键或删除 html 按钮时它应该实现。这就是为什么我试图理解clea
我正在尝试使用 Retrofit 连接到 android 上的 https 服务器。这是我的 OkHttpClient @Provides public OkHttpClient provideCon
我收到来自 Android 8 用户的报告,我的应用(使用后端 Feed)不显示内容。经过调查,我发现 Android 8 上发生了以下异常: 08-29 12:03:11.246 11285-112
我在我的应用程序中使用 Picasso 2.5.2。它运行良好,但无法从第三方服务器之一加载图片。当我尝试从该站点加载图片时出现此错误: java.net.UnknownServiceExceptio
我们的 Android 9 UI 测试失败了,因为我们的测试环境不使用 HTTPS。问题是我们正在从 espresso 测试进行网络调用(例如直接在后端创建全新用户以用于测试)这意味着它们在 espr
我收到来自 Android 8 用户的报告,我的应用(使用后端 Feed)不显示内容。经过调查,我发现 Android 8 上发生了以下异常: 08-29 12:03:11.246 11285-112
我收到来自 Android 8 用户的报告,我的应用(使用后端 Feed)不显示内容。经过调查,我发现 Android 8 上发生了以下异常: 08-29 12:03:11.246 11285-112
我收到来自 Android 8 用户的报告,称我的应用(使用后端提要)不显示内容。经过调查,我发现 Android 8 上发生了以下异常: 08-29 12:03:11.246 11285-11285
我正在使用 webview_flutter 插件加载本地主机上托管的页面(使用 dart 创建的服务器,在手机上)但我得到 net::ERR_CLEARTEXT_NOT_PERMITTED 并且我可以
我正在尝试向 http 服务器发出 post 请求,但是当我尝试获取输入流时,我收到错误 java.io.IOException: Cleartext HTTP traffic to x not pe
本文整理了Java中org.apache.poi.xssf.usermodel.XSSFSimpleShape.clearText()方法的一些代码示例,展示了XSSFSimpleShape.clea
我是一名优秀的程序员,十分优秀!