jQueryクリアinput値を取得するいくつかの方法

3423 ワード

$('.class').val()
$(" #id").val()
$(" input[ name='name' ] ").val()
$(" input[ type='text' ] ").val()
$(" input[ type='text' ]").attr("value")
           .val()
       
$(" #id").val(“”);
    console.log($(" #id").val(“”))          
  alert($(" #id").val(“”))  [object Object]      (         )
         ,        Object   toString()  。

({}) :"[object Object]";
([1,2,3]) :"1,2,3";
(100) (true) :"100","true";
(User) :"function User(){...}";
(String) :"function String(){[native code]}"