Get the value in with Jquery


Now we will see the command .val (). val() allows us to get data from form elements. Normally we get the contents of html elements with text () or html (), but we can not get form elements with them. So we will get the form elements with val () command.

Html and Jquery

  • First of all we need the jquery library


  • Then add an html to the input text field and set the id

  • Let’s write the script code we checked

  • The important part here is that we will take the value of the id value that we have in the document ready.

General Code

  • You can write this code in a html file and open it in a browser.

Run Code

Good luck with 🙂


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *