jquery radio、checkbox 選項 內存問題

$("[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");
    });

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章