【DW組隊學習—LeetCode】day17
阿新 • • 發佈:2021-01-29
技術標籤:javascript
$("#routebox-plans").on("click",":radio",function (){ var str = $(this).attr("id"); var newstr ; if (str.indexOf("main") != -1){ newstr = str.replace(/main/, "second") }else { newstr = str.replace(/second/, "main") } console.log(str); if($("#"+newstr).is(':checked')){ $("#"+newstr).prop('checked', false); } });