Hi I'm trying to append javascript code when I click a button, but I think I messed up. If someone could help me with syntax. Maybe I'm doing it the wrong way; if someone has a better way to do it, it would be appreciated.
$("#btn_add").click(function(){
'<script>$(".selectcategory'+count+'").change(function() {var vv = ($(this).val());$( ".cat'+count+'" ).empty();$(".cat'+count+'").append("<input id="i_index" type="text" name="categorie[]" maxlength="255" style="width:80%" value="vv">");});</script>'
});