2
我有這樣的代碼:真假條件直列
<input type='checkbox'>
我要讓有條件使用jQuery,例如,如果data[1].condition
是true
,然後將其選中,如果沒有的話不。
可能是這樣的:
<input type='checkbox' + if data[1].condition is false, unchecked + "'>
<input type='checkbox' + if data[1].condition is true, checked + "'>
有沒有一種方法來設置它內聯?例如:
<input type='checkbox' + data[1].condition | checked + "'>
你是否使用任何JS庫或JS? – user1027620
你使用了什麼樣的模板語言?你不能只用HTML來做到這一點。 – Steve
我很困惑...你想避免JS或jQuery? –