How do I retrieve dynamic user input text from input box?

Hello,

I’m trying to save the value that a user types into an input box. Then, I’d like to console.log this value in an output box. I assumed that I could just grab the input using some javascript like:

var element = document.getElementByName(‘targetElement’);

However, this triggers an unreadable error. Does anyone know how to do this?

Hi there!

Thanks for reaching out to Builder support.

There are various ways to grab the value of an input, one of my go-to’s is document.getElementById('#some_input_id').value, store this into a variable, and then you would be able to console.log it out.

I’ve linked a helpful StackOverflow article below for further reference: