Inside my C code that will be compiled by Emscripten
How do I create an HTML element?
There is this emscripten function
Target HTML element id
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.