How to get the value of an input input box with jquery?

【Foreword】

    Student question: How to get the value of the input input box with jquery?

 

 

【main body】

   Here I give an example to understand

    How to get the value entered in <input id="test" name="test" type="text"/> with jquery?

$(" #test ").val()
$(" input[ name='test' ] ").val()
$(" input[ type='text' ] ").val()
$(" input[ type='text' ]").attr("value")

 

【expand】

    About form clearing data

    $('form').get(0).reset();Limited, the data obtained from the database cannot be cleared, only the newly entered characters can be reset. I will have time to summarize this tomorrow.

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326063177&siteId=291194637