Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Custom Question Boxes with JavaScript and HTMLifier
- elijahf10
-
Scratcher
44 posts
Custom Question Boxes with JavaScript and HTMLifier
I made a project that has a fully custom question box using my bad JS skills and Sheep_maker's HTMLifier.

The HTMLifier question boxes are styled 100% with CSS, so I was able to throw together some JS that could change its CSS properties.
The HTMLifier question boxes are made up of an HTML div, label, and input element with the following ID's:
My custom script declares two functions that set either the default box style or a custom one that I made. They can be called at any time within the Scratch project using the HTMLifier's eval() ability.
Additional notes:
Link to project: Custom Asking Boxes

The HTMLifier question boxes are styled 100% with CSS, so I was able to throw together some JS that could change its CSS properties.
The HTMLifier question boxes are made up of an HTML div, label, and input element with the following ID's:
- question, which contains the question specified in the Scratch block (only shows when used by the background sprite)
- answer, the input field for typing your answer
- asking-box, a div that wraps the question and answer together
My custom script declares two functions that set either the default box style or a custom one that I made. They can be called at any time within the Scratch project using the HTMLifier's eval() ability.
Additional notes:
- This isn't a magic script you can throw in an HTMLified project. I had to link the script in the HTML file and also changed some CSS independently from the JS.
- The two functions created are defaultAskingBox and prettyAskingBox. They are run when the respective button in Scratch is clicked.
- The question/answer/asking-box method cannot work on vanilla Scratch. The HTMLifier uses a different question box system than vanilla Scratch.
Link to project: Custom Asking Boxes
Last edited by elijahf10 (June 17, 2020 23:39:21)
- ThinTek
-
New Scratcher
1 post
Custom Question Boxes with JavaScript and HTMLifier
Hi! The original link to the project that you provided no longer works. Is there anyway that I can still access the project?
Thanks!
Thanks!
- Steve0Greatness
-
Scratcher
1000+ posts
Custom Question Boxes with JavaScript and HTMLifier
Hi! The original link to the project that you provided no longer works. Is there anyway that I can still access the project?Welcome to the forums. Please note that when you find a topic, you should generally make sure that it has had active users on it.
Thanks!
People don't tend to like to see an over 2 year old post on the first page of any forum category.
I would however like to ask you to read A guide to the forums for new scratchers! by @asqwde. As well as reading Welcome to the Advanced Topics! by @Hardmath123, which is more specific to the general rules of this forum category.
If you have any other questions, you can seek these guides out. They're generally pinned(signified by them always staying at the top of the first page and with the
Last edited by Steve0Greatness (April 6, 2023 23:57:49)
- Discussion Forums
- » Advanced Topics
-
» Custom Question Boxes with JavaScript and HTMLifier