Missing language/ library?

Hey, I tride to copy a code from p5 preferences to make a button. I got some error saying some of the codewords were missing. Im wondering if there is some library or language I’m missing.

var button

function setup() {

function draw() {
  button1 = createButton('1')
  button.position (20,300)

also, if you know any other ways to make a button, I would be happy to hear about them:)

just realized I called the button for button1, but still doesn’t work…

hi, createButton needs Dom library.

<script type="text/javascript" src="p5.dom.js"></script>

and for button.mousePressed()

or something like


function backgroundChange() {
1 Like