forum

Home / DeveloperSection / Forums / How to change value of input with jquery under this class?

How to change value of input with jquery under this class?

Anonymous User 2342 30-Jan-2015

jQuery:

$('.clickhere').click(function(e){
    e.preventDefault();
    $(this).closest('.row').children('.abc').hide(); // working
    $(this).closest('.row').children('.abc').children('input').value = ''; // not working
    $(this).closest('.bookingrow').children('.addressbox').children('input').value(''); // alternative - not working
});

html

<div class="row">
  <div class='abc'>
     <input type='text'class='unknown' />
  </div>
  <div class="clickhere">hide</div>
</div>

my target is if i click the "clickhere" class, content under "abc" class will hide and whatever content added by customer on those input box, they will be clear.

same html used multiple time on the same form. that's why using "$(this)".
any solution? what i am doing wrong?
Thanks in advance.


Updated on 30-Jan-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By