Get value from input

Hi! You need to get the value of the filled field:

var mailData = $("input.for-mail").val();

If the value is filled in manually initially, then everything is OK. But it is not possible to get the value filled in by the user (judging by the inspector, the entered value is not written to value at all for some reason).

How do I get the data entered in the input?

Author: ilyaloser, 2014-09-29

1 answers

The problem is that you get the mailData variable once, when the page loads, and the default value is always there. Transfer the receipt of the text field value to the click event handler.

 6
Author: andreyqin, 2014-09-29 18:06:18