I’m making a login form where the user builds their username from 3 separate drop-down menus, where they select an adjective, color, and an animal. However, to avoid having users click through the menus (clicking on the top for every drop down) and building the same user name, I want to randomize each select menu.
I made an html page with a script that randomizes the order an array of values and appends them to an html select tag. However when this page is loaded into my phaser game with:
this.domOverlay = this.add.dom(180, 300).createFromHTML('html_login');
It fails to generate the select menus, most likely because I think Phaser is literally only taking the HTML and ignoring the JS I wrote.
Is there any way to append option elements to a select element after Phaser creates an overlay?
I read here (https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.DOMElement.html#getChildByID__anchor) that there is a function to grab the child by its ID, however I think this is more for getting values of a form, not appending to a DOM. Also, at this point, this is a phaser object I believe, so it might not be possible to append at all? What should I do if I want to randomize the select element options? I’m thinking of building a form in Phaser rather than use HTML, but this way would save me work.