How to have two different inputs (one for mobile, one for desktop) modify the same variable?

0
(0)

//How to have two different inputs (one for mobile, one for desktop) modify the same variable?

Use :visible selector

username = $("input[name=userSearch]:visible").val();
$("input[name=userSearch]:visible") will be the visible input field.

 

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Share this post on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?