knowledgenotebook
2/25/2015 2:10:00 AM
On Tuesday, February 24, 2015 at 6:10:58 PM UTC-5, Stefan Ram wrote:
> justaguy <lichunshen84@gmail.com> writes:
> >add a new list inside an element of an existing list
>
> Main.html
>
> <!DOCTYPE HTML><html><head><meta charset="UTF-8">
> <title>Main</title><link rel="stylesheet" href="main.css"></head><body><ol>
> <li id="food">Food</li>
> <li>Drinks</li></ol>
> <script type="application/javascript;version=1.8" src="main.js"></script>
> </body></html>
>
> main.css
>
> main.js
>
> "use strict";
>
> function insertSublist()
> { "use strict";
> document.getElementById( "food" ).
> appendChild( document.createElement( "ol" )).
> innerHTML = "<li>muffin</li><li>pizza</li>" ; }
>
> function onDOMContentLoaded()
> { "use strict";
> insertSublist(); }
>
> function wireDOMContentLoaded()
> { "use strict";
> document.addEventListener
> ( "DOMContentLoaded", onDOMContentLoaded, false ); }
>
> wireDOMContentLoaded();
Thank you very much for your method of solving this problem.
Sorry, I wasn't clear, that is, the content in a given iframe is unknown to us, hence, we don't know if an element from the parent list is "food" or something else, same is true for "muffin" etc. And I don't think we have an id for each element neither. Is it still solvable?