1

fairly new programmer here.

I've recently been trying to use p5.js to create a username and password form. It's worked wonderfully, at least until I needed to make the password field private (and look like a password field)

I know that there is the <input type="password"> option in HTML, but I was wondering how to incorporate this somehow into my p5.js code.

Thank you!

My code:

password = createInput();
password.position(70, 265);
Kevin Workman
  • 41,537
  • 9
  • 68
  • 107
ed Luebke
  • 13
  • 3

1 Answers1

0

The best way to answer questions like this is to read through the reference. Here is the reference for the createInput() function.

createInput([value], [type])

Parameters

value String: default value of the input box type String: type of text, ie text, password etc. Defaults to text

So it sounds like you probably want to do something like this:

password = createInput('', 'password');

Also note that you can probably use the createElement() and attribute() function to build the element manually.

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107