cve60069 Posted March 21, 2013 Share Posted March 21, 2013 Hello I want to dynamically add lines of code into an existing HTML document. I want to create a list of materials but the list is unknown. It could be two or five. I will create the list using Javascript and then insert the list into the HTML document. All of the code below the insertion will move down accordingly. I have seen it done using PHP but I want to do this in my browser. Should I be considering a jquery plugin as a method, similar to WOWslider?. Tutorials, advice or an example would be appreciated. Regards Link to comment Share on other sites More sharing options...
Spunky Posted March 22, 2013 Share Posted March 22, 2013 I would suggest asking this in the JavaScript forums. You can certainly accomplish this using JavaScript. One property I know of is .innerHTML. JavaScript is very nice about doing things dynamically. Judging by your general description of what you wish to accomplish, .innerHTML should do the trick. Link to comment Share on other sites More sharing options...
thescientist Posted March 25, 2013 Share Posted March 25, 2013 you could use innerHTML, or if you are rendering a list, it would make most sense to append <li> elements to an <ul> or <ol> element, that could already be on the page. But yes, you are correct in asserting that JS is needed. 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