skip to Main Content

how to append text to its own div container without appending it to the other div container? – Jquery

what the jquery code does below is it only clears the textbox $(document).ready(function(){ var someText = $(".someText"); $(".add").on("click", function(){ $(".container", this).append(someText.val()); $(someText).val(""); }); }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="container"> <div class="add">+</div> <input class="someText" type="text"> </div> <div class="container"> <div class="add">+</div> <input class="someText"…

VIEW QUESTION
Back To Top
Search