Wusevar i Wusevar i - 1 year ago 187
C Question

emscripten document.createElement in C

Inside my C code that will be compiled by Emscripten

How do I create an HTML element?

There is this emscripten function

that requires a
Target HTML element id

How can I get this id after creating an HTML element?

Answer Source

The target argument of emscripten_request_pointerlockis described in the Emscripten documentation here. If you pass a value of 0 it will apply to the default canvas element of Emscripten. If you want it to apply to some other element you can just pass the id of that element as a string. Presumably if you're creating the HTML element you will have control over what its id is, so just pass that.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download