选中复选框时如何启用文本框? [英] How Do I Enable Textbox When I Check Checkbox?
本文介绍了选中复选框时如何启用文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样的领域
学生分数
C ++ [复选框]文本框用于
所以最初应该禁用文本框,但是当我选中该复选框时,它应该启用...
I have field like this
Student Marks
C++ [checkbox] textboxfor
so initially textbox should be disable but when i the checkbox is checked it should get enable...
can anyone give a hint?
推荐答案
请尝试如下操作.
HTML
Please try is as below.
HTML
<input type="checkbox" name="marks" id="marks" />
<input type="text" name="studentMarks" id="studentMarks">
JS
JS
(文档).ready(function(){
(document).ready(function() {
(" ).attr(' '
("#studentMarks").attr('disabled','disabled');
这篇关于选中复选框时如何启用文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文