Users Pricing

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 2679 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.


I am a content writter !


1 Answers