jQuery append string -


Hello Stack Overflow I hope you are well today,

I have this code:

  $ ('. Add_child'). Click (function () {var attrName = $ (this) .attr ('name'); var count = $ (this) .attr ('count'); $ (This) .attr ('count', (parseInt ('' Type ',' text ') input.attr (' name ',' attrName + '[" Attachments ('<+ [Input] +' & lt; / li & gt; ');})   

I am trying to get my effort to display in this form:

    

But it is not working properly. I get this code in my html

    

I believe this line is giving me this issue:

  $ ('.baby_form') .andend ('& lt ; Li & gt; '+ [input]' & lt; / li & gt; '); You are creating an array with   

[input] but ' input is an object, not HTML

You will need to:

  $ ( '. Children_form'). Attachments ($ ('& lt; li / & gt;').));   

counts is not a valid HTML attribute you should use instead you can set the initial value with one attribute in the format: Data-count = "0" .

Comments