快速的問題......我想知道如何才能讓它發生。如何使用Jquery設置輸入字段的Name屬性?
好吧,我有一個輸入字段像這樣:
<input type="text" id="input1" size="10" name="" value="" class="checked other_amount" onfocus="Toggle('radio1', 'input1');" />
我想點擊一個div #resetPrompt的ID,並填補了空的name屬性從輸入與「other_amount」
我的想法它是一個漫長的一天
謝謝你們,
馬特
正如前面所指出的,這贏得了」 t在MSIE7及更高版本中工作。解決方法是使用.prop(..)重寫內部行: $('#input1')。attr('name','other_amount')|| $('#input1')。prop('name','other_amount'); – esteewhy 2013-11-18 16:32:03