我得到這樣的錯誤:
Uncaught TypeError: 不能讀取屬性of undefined (讀取'append')
我的目標是在觸發圖示選取器功能的同時改變輸入值。
我的代碼:
$(document).ready(function(){
$('.input1').iconpicker(" .input1")
.append( "<p>Test</p>" ) 。
$('#inputid2').iconpicker("#inputid2")。
$('.input3').iconpicker(".input3") 。
});
< input type="text" class="input1 input"/>
<br/><br/>
<h4>Value == Amazon</h4>
< input type="text"/span> class="input" id="inputid2" value="fa-amazon"/>
<br/><br/>
<h4>Just for fun</h4>
< input type="text" class="input3 input"/>
<br/><br/>
uj5u.com熱心網友回復:
你需要在jQuery中添加元素索引,因為選擇器會回傳一個陣列
。 $('.input1') [0]
uj5u.com熱心網友回復:
我從js檔案中解決了這個問題。我把我的任務添加到函式中。
jQuery(this)。 addClass('selectedicon') 。
if ( jQuery(selector)。 attr('class') == whichInputClass && jQuery(選擇器)。 attr('id') == whichInputId) {
jQuery(selector).val('fa-' getIconId).change()。
$('.input1').append(('fa-' getIconId)); //我添加了這一行。
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/321667.html
標籤:
上一篇:如何只映射影像的部分源屬性
下一篇:查找字串操作消除單詞ABAP
