Skip to content

How to find previous and next text box in jquery

Nikhil Ladva

Asked Oct 14, 2016, 1:09 AM EDT2 answers
Share
LinkedInX
i create dynamically text box so how to find previous and next text box using jquery in asp.net mvc

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    SQL
    $(this).nextAll(".in").first().val(); // next sibling with class ".in" $(this).parent().find(".in").first().val();
    0
  • 0
    Hello Nikhil ,
    you can use some thing likeparent(), child methods which are avilable in Jquery to get the elements from HTML Page.
    for eg:$("input [title^='Role'").parent()
    with the above example you can get the prev element of the Text box.
    0