# Adding HTML elements

**URL:** <https://phaser.discourse.group/t/adding-html-elements/278>\
**Category:** Phaser 3\
**Created:** [December 12, 2018, 11:17am UTC](https://phaser.discourse.group/t/adding-html-elements/278 "2018-12-12T11:17:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pietjePuk](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pietjePuk](https://phaser.discourse.group/u/pietjePuk)\
**Post date:** [December 12, 2018, 11:17am UTC](https://phaser.discourse.group/t/adding-html-elements/278/1 "2018-12-12T11:17:37Z")

</div>

Hello,  
Is it already possible to add HTML elements because i can’t find any examples for it?  
I’m trying to add a dropdown where users can choose a particular item, nothing special, just don’t know how to add it.

Thanks,  
Pietje

---

<div class="post-metadata">

**Author:** ![cincospenguinos](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/cincospenguinos/32/197_2.png) [@cincospenguinos](https://phaser.discourse.group/u/cincospenguinos)\
**Post date:** [December 13, 2018, 3:58pm UTC](https://phaser.discourse.group/t/adding-html-elements/278/2 "2018-12-13T15:58:28Z")

</div>

I don’t think that’s something that Phaser can handle. Phaser is designed for creating HTML 5 games in a `<canvas>` element. There’s a variety of other libraries you could use to add or interact with HTML elements though. [jQuery](https://jquery.com/) would be the one that I recommend.

---

<div class="post-metadata">

**Author:** ![snowbillr](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/snowbillr/32/332_2.png) [@snowbillr](https://phaser.discourse.group/u/snowbillr)\
**Post date:** [December 13, 2018, 6:25pm UTC](https://phaser.discourse.group/t/adding-html-elements/278/3 "2018-12-13T18:25:03Z")

</div>

Actually you can! In a recent release, Phaser added support for dom elements.

Take a look at the examples in this folder: [https://labs.phaser.io/index.html?dir=game%20objects/dom%20element/&q=](https://labs.phaser.io/index.html?dir=game%20objects/dom%20element/&q=).

---

<div class="post-metadata">

**Author:** ![Telinc1](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/telinc1/32/60_2.png) [@Telinc1](https://phaser.discourse.group/u/Telinc1)\
**Post date:** [December 13, 2018, 7:39pm UTC](https://phaser.discourse.group/t/adding-html-elements/278/4 "2018-12-13T19:39:37Z")

</div>

DOM Elements are still experimental and, according to Phaser’s production build configuration, excluded from any of the release builds. You’d have to use a development build or build Phaser on your own, keeping in mind that they could malfunction.

As far as I’ve heard, they’ll be finalized after the Scale Manager is implemented but don’t quote me on it.

---

<div class="post-metadata">

**Author:** ![wclarkson](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/wclarkson/32/205_2.png) [@wclarkson](https://phaser.discourse.group/u/wclarkson)\
**Post date:** [December 14, 2018, 12:06am UTC](https://phaser.discourse.group/t/adding-html-elements/278/5 "2018-12-14T00:06:46Z")

</div>

I’m working on a series of blog posts on this topic right now, because I ran into the same problem at work.

> **[Phaser 3 Input Text - Form Ui- Part 1 - Phaser Games](https://phasergames.com/phaser-3-input-text-form-ui-part-1/)**
>
> Phaser 3 Input Text About a month ago I needed to find a way to implement a Phaser 3 input text field. This was due to needing to put a …

It works by creating and hiding the HTML elements in your index.html and then accessing them from Phaser

this.formUtil = new FormUtil({  
scene: this,  
rows: 11,  
cols: 11  
});  
this.formUtil.showNumbers();  
//  
//  
//scale the element to a percentage of the game’s width  
this.formUtil.scaleToGameW(“myText”, .3);  
this.formUtil.placeElementAt(16, ‘myText’, true);
