0
我有這樣的功能:jquery,我該如何避免這種選擇器重複?
$('#barcode').JsBarcode($('#barcode').attr("data-barcode"), {
format:"EAN"
displayValue:true
fontSize:10
height: 22
marginLeft: 10
marginRight: 10
marginTop: 3
marginBottom: 0
})
它的工作,但我想避免重複。我試着用this
和$this
沒有成功...
'$ this'和'this'只能在函數的上下文中使用。 –