0

I am changing this code I have to jquery, and I want to get the inputString. how is this done with jquery. I imagine I should use .val() , but I cant see where it would fit in. Thanks

$(document).ready(function() {
   $("#email").keyup(function() {

      if(inputString.length == 0) {
         //do something

      }
   });
});

     <input type = "text" id = "email">

1 Answer 1

3

Besides you may use $(this).val() but the following way is faster:

$("#email").keyup(function() {
    var inputString = this.value;
    // ...
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.