Not able to create child Element for type "ul" or "ol"

21 views
Skip to first unread message

Sharad Sahu

unread,
May 26, 2022, 8:23:23 AM5/26/22
to emscripten-discuss
Hi ,
I am trying to create a list "ul" or "ol" dynamically .

 Successfully created container element for type “ol”.

emscripten::val  parent = document.call<emscripten::val>("createElement",std::string("ol"));

·        Child element creation is also successful for element type “li”

emscripten::val  chld = document.call<emscripten::val>("createElement",std::string("li"));

·        But adding child to parent is not happening.

      parent.call<void>("appendChild", chld);

//parent.call<void>("append", chldElement);

·        But the same child elements are successfully get added to container.

if (!container.isUndefined())

          container.call<void>("appendChild", chld);

please suggest what is wrong here.

Reply all
Reply to author
Forward
0 new messages