jquery radio、checkbox 选项 内存问题
2015-07-24 09:26
686 查看
$("[checked]:not(:checked)").removeAttr("checked");
$("div[id='form_body'] textarea").each(function() {
$(this).text($(this).val());
// $(this).attr("readonly","readonly");
});
$("div[id='form_body'] select").each(function() {
$(this).find("option:not(:selected)").removeAttr("selected");
$(this).find("option:selected").attr("selected", "selected");
});
$("div[id='form_body'] :radio").each(function() {
if ($(this).is(":checked")) {
$(this).attr("checked", "checked");
}
// $(this).attr("readonly","readonly");
});
$("div[id='form_body'] :checkbox").each(function() {
if ($(this).is(":checked")) {
$(this).attr("checked", "checked");
}
// $(this).attr("readonly","readonly");
});
$("div[id='form_body'] textarea").each(function() {
$(this).text($(this).val());
// $(this).attr("readonly","readonly");
});
$("div[id='form_body'] select").each(function() {
$(this).find("option:not(:selected)").removeAttr("selected");
$(this).find("option:selected").attr("selected", "selected");
});
$("div[id='form_body'] :radio").each(function() {
if ($(this).is(":checked")) {
$(this).attr("checked", "checked");
}
// $(this).attr("readonly","readonly");
});
$("div[id='form_body'] :checkbox").each(function() {
if ($(this).is(":checked")) {
$(this).attr("checked", "checked");
}
// $(this).attr("readonly","readonly");
});
相关文章推荐
- 基于jQuery图片遮罩滑动文字切换特效
- [英] 推荐 15 个 jQuery 选择框插件
- 基于jquery的图片懒加载js
- 可以浮动某个物体的jquery控件用法实例
- Jquery简单分页实现方法
- jquery使用
- Jquery -- 常用选择器 和 div/select/radio/checkbox的使用
- jQuery-mobile 学习笔记之三(事件监听)
- jquery-mobile 学习笔记之二(表单创建)
- jquery-mobile 学习笔记之一(基础属性)
- jQuery知识点总结(第六天)
- SpringMVC+JQueryMobile开发 data-external-page与JQM机制
- jQuery之选择器
- 如何用jquery写一个简单的返回顶部
- Jquery例子: 复制表一的某一列的内容到表二某列的输入框
- jQuery源码框架思路
- jquery 的ajax的同、异步问题
- jquery ajax CORS 跨域访问 WebService
- jQuery 源码分析4: jQuery.extend
- 非常简单的使用jquery fancybox插件实现的查看图片效果