cve60069 Posted May 23, 2013 Share Posted May 23, 2013 hello I am trying to add a line to a document and edit its contents. I have used jquery clone method (attached). I want to create just one line. i know why I am going wrong but I do not know how to solve. I think it is the ".append($('.item')", This needs to be ".append($('last cloned item')" - maybe. Any hints would be appreciated Regards paragraph.html Link to comment Share on other sites More sharing options...
justsomeguy Posted May 23, 2013 Share Posted May 23, 2013 Using .item is going to target everything with the class item. Maybe you should use ID instead, or use DOM methods to get that node. With that structure it is the second child of the body, so you can target it with document.getElementsByTagName('body')[0].childNodes[1]. Note that appending to the item is going to put one div inside the other one, not next to each other. If you want them next to each other then you need to append the new element to the body, not the div. Link to comment Share on other sites More sharing options...
cve60069 Posted May 24, 2013 Author Share Posted May 24, 2013 Thank you Link to comment Share on other sites More sharing options...
cve60069 Posted May 26, 2013 Author Share Posted May 26, 2013 paragraph.htmlDear moderator I need to write the lines in a modal (attached). What would I substitute for 'body', please. I understand the childnode. Thank you for your time. Regards Link to comment Share on other sites More sharing options...
cve60069 Posted May 27, 2013 Author Share Posted May 27, 2013 Solved it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now