我的代码里面需要一个清晰的功能! [英] i need a clear function inside my code !
本文介绍了我的代码里面需要一个清晰的功能!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要做一个明确的功能!
i有DIV FULL OF INPUTS,DDL,CheckBoxes等......
i需要将其所有值设置为null之后每次操作!
我试过这个:
i need to make a clear function !
i have DIV FULL OF INPUTS , DDL's , CheckBoxes , etc ...
i need to set all its values to null after every operation !
i've tried this :
me.claerControls = function (id) {
$("#" + id + "[type='text']").val('');
$("#" + id + "[type='radio']").prop('checked', false);
};
让我说通过#UserEdit一个ID为什么值没有被清除?在调用函数时我在这里错过了什么?
lets say im passing "#UserEdit" as an ID why the values are not being cleared ? when calling the function what did i miss here ?
推荐答案
( # + id + [type ='text']) .val(' ');
("#" + id + "[type='text']").val('');
( # + id + [type ='radio'])。prop(' checked', false );
};
("#" + id + "[type='radio']").prop('checked', false); };
让我说通过#UserEdit一个ID为什么值没有被清除?在调用函数时我想念的是什么?
lets say im passing "#UserEdit" as an ID why the values are not being cleared ? when calling the function what did i miss here ?
好的,这里的问题是选择器的含义。
Ok, the problem here is the meaning of your selector.
me.claerControls = function (id) {
这篇关于我的代码里面需要一个清晰的功能!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文