Input value to UpperCase()

I have a HTML reference to an input value that I would like to set in uppercase. I’ve tried the code below, but I still get capslock sensitive input values…

const input_field = document.getElementById(’#input_field’) ;


Mind the name: input_field :smile:

That said you probably want to assign the upper case value to the input value, so you need an assignment operation:

input_field.value =  input_field.value.toUpperCase();

Hope this helps

Aah, I see! Thanks a lot!

To be fair, toUpperCase is a function that returns a new string, it’s up to you to do what you want with that returned value :+1: