Use jQuery to append response to individual HTML elements without duplication
Clash Royale CLAN TAG #URR8PPP Use jQuery to append response to individual HTML elements without duplication I am trying to store the result of each form submission into its own individual HTML element. My code is doing this but it's also duplicating the results. Is there a way to append the result just the once rather than to all matching classes without creating uniquely identifiable elements (e.g. card1, card2, card3). <form id='userForm' method="POST"> <input class="textbox" type='text' name='query' placeholder='Question' value="" /> <input type='submit' value='Submit' /> </form> <div class="responses"></div> <script> $(document).ready(function(){ $('#userForm').submit(function(){ var question = $(".textbox").val(); $.ajax({ type: 'POST', ...