我有这个:
form = $('#<%= params[:board_id] %>');
var $parent = form.closest(".biscuit").eq(0);
我希望获得form
和$parent
如果我写:
alert($parent).value();
或alert(form).value();
我收到提醒[object Object]
。
如何获取form
和$parent
的值?
答案 0 :(得分:0)
您写道:
alert($parent).value();
或alert(form).value();
相反你应该写:
alert( $parent.val() );
或alert( form.val() )
您编写的内容,警告$parent
jQuery对象,然后尝试在结果上调用方法value()
...