$( document ).ready( function() { var tags = 1; $( '#insert_tag' ).click( function() { tags += 1; document.getElementById( 'tags_input' ).innerHTML += "<div id=\"t"+tags+"\">Tag: <input type=\"text\" name=\"tag_"+tags+"\" id=\"tag_"+tags+"\" /> <a onclick=\"removeTagInput( "+tags+" );\" style=\"color: red;\">usuń</a></div>"; $( '#tags_count' ).val( tags ); }); });
I taki div
Problem polega na tym, że wpisuję jakąś wartość do tego inputa, klikam na button od id insert_tag, jego zadaniem jest dodanie kolejnego input'a do tego diva, i jest ok bo dodaje ale nie do końca gdyż dodanie tego usuwa wartość WSZYSTKICH wcześniejszych inputów w div#tags_input...
pomocy