I have the following code, basically:
<form>
<p class="comment-form-comment"> <textarea id="comment" ></textarea> </p>
<p class="form-submit" style="display: none;"><input id="submit" value="submit" type="submit"></input> </p>
</form>
I have the following javascript:
jQuery('form').on('click','p.comment-form-comment', function(){
jQuery("p.form-submit").css('display', 'block');
});
The form is a looped item and I’m trying to select the submit button that belongs to the clicked textarea, instead of all of the buttons. I can’t seem to wrap my head around it although it seems like it would be easy enough.
I set up a jsFiddle here: http://jsfiddle.net/ZJx3k/1/
1 Answer