Users Pricing

forum

Home Forums How to change value of input with jquery under this class? – MindStick

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

Anonymous User 2759 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.


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md