我有一組文件輸入字段,我希望除第一個以外的所有項都被禁用。選擇下一個相鄰元素JQuery
當第一個設置(onchanged)時,下一個文件字段被解鎖。
我該怎麼做?我曾嘗試:
$('#topperform input').change(function(){
$(this).next('label').css('color', 'red') ;
})
這什麼都不做。
我的HTML:
<form id="topperform" method="post">
<label>Main image <input type="file" /></label>
<label>2nd image <input type="file" /></label>
<label>3rd image <input type="file" /></label>
<label>4th image <input type="file" /></label>
<label>5th image <input type="file" /></label>
<label>6th image <input type="file" /></label>
<label>7th image <input type="file" /></label>
<label>8th image <input type="file" /></label>
<label>9th image <input type="file" /></label>
<label>10th image <input type="file" /></label>
</form>
我可能是錯誤的,但爲什麼ü把$( '#topperform輸入'),而不是$( '#topperform')? – Drakoumel