當使用 attr 第一操作沒問題
$(this).parents(“li”).children(“input”).attr(“checked”, true) ;
多次操作后發現問題:頁面元素變化,但渲染沒有改動
我們需要采用jquery prop:
$(this).parents("li").children("input").prop("checked", true) ;
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/293465.html
標籤:其他
上一篇:【超實用技巧】?| 提高寫文的質量 和 速率必學技能:?? Typora 圖床配置 詳細說明 ?? 【Windows版】
