How do I submit value of a “custom” input in a form?

I’m wirting a CRUD application and I ran into this problem today:
There’s a form where user can set the entry’s priority (basically a number from 1 to 3). But instead of an input with type=”number” or anything similar, I created a “custom” input. It’s a small circle that changes colors when you click it (colors represent numbers from 1 to 3). My question is: how do I submit this value to the form?

The solution I came up with was to use an input with type=”hidden” and before the form is submitted, javascript changes the input’s “value” attribute to match the number selected in the “custom” input. This seems to be working but according to MDN type=”hidden” inputs are used for “data that cannot be seen or modified by users when a form is submitted”, so I’m guessing this is not a typical solution to this kind of problem. Is there some kind of agreed upon method for this problmes like this?