EasyUI是否只捕获带有ID属性的元素?

Does EasyUI Catch Elements Only With ID Attribute?

本文关键字:属性 ID 元素 是否 EasyUI      更新时间:2023-09-26

我有一个这样的数字输入:

<input class="easyui-numberbox" data-options="precision:2,required:false" id="price3" name="price3" value="" />

但是我不能得到输入值:

$("input[name=price3]").numberbox('getValue')

但是我可以用input的ID属性获得输入值:

$("#price3").numberbox('getValue')

我应该定义我的所有输入ID属性与EasyUI工作?

认为,

您也可以获得具有特定属性值的元素。在您的示例中,尝试

$('input[numberboxname="price3"]').val()