使用jQuery从输入字段获取值
我想从输入字段中获取值。 代码如下所示:使用jQuery从输入字段获取值,jquery,shopify,Jquery,Shopify,我想从输入字段中获取值。 代码如下所示: <input type="number" step="any" name="properties[wallpaper_size_width]" class="spb-productdescfont spb-productoptiontextcolor spb-productoptionbackground" placeholder="Breite in cm" required=""> 这是行不通的。我被[]@这个名字弄糊涂了= 如何
<input type="number" step="any"
name="properties[wallpaper_size_width]" class="spb-productdescfont
spb-productoptiontextcolor spb-productoptionbackground"
placeholder="Breite in cm" required="">
这是行不通的。我被[]@这个名字弄糊涂了=
如何通过名称选择值?您可以像这样使用
名称
选择器
$('.getVal')。单击(函数(){
var值=$(“[name='properties[wallpaper\u size\u width]']”)。val();
console.log(值);
});代码>
单击“我”
try this$(“[name='properties[wallpaper\u size\u width]]”)的可能重复项。value()代码>
$("#height").value();