getElementById from html code

For developers using the Construct 2 Javascript SDK

Post » Fri Mar 17, 2017 8:14 am

How i can getelementbyid from div ?
my html:

<body>

<div id="name">my player name
</div>

<div id="c2canvasdiv">
<canvas id="c2canvas" width="1000" height="500">
</canvas>
</div>
</body>

now i must use CAllJS or something plugin to get player name from div ID. What i must write in execute?
i add to construct this JS to calljs:
"var "&name_player&" = document.getElementById('name');"

next
i set text --> name_player

but this dosent work;/


how i can put player name from website to construct? im not developer please help me friends
B
10
S
3
G
1
Posts: 21
Reputation: 782

Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests