Hello, im trying to do the color scheme generator but idk how to pass the hex code i get from the color input value and the mode value to pass it to the api, i do get the value as you can see in the console but i don't know how to pass it to get a color scheme around that color, if i try ${colorScheme.value} and ${mode} i get an error
#How to pass a value to a request
1 messages · Page 1 of 1 (latest)
It looks like colorScheme and mode are HTML elements in the DOM. Don't you want to get the values in those elements and send that data in the API call?
i do get the values from colorScheme and mode from the dom as you can see in the console, i succesfully used the values from the mode but cant use the values of the colorScheme, it just dosent work idk why
i did it, i forgot a & before mode=${mode}
i searched for 3 hours why it dosen't work because the mode value was working but that one didn't 🙂
i kept the document.getelementById on the cholorScheme and added it to the api cal as cholorScheme.value.slice(1) to get rid of the #
Based on the code in your screenshots, the console log is displaying the values of mode.value and colorScheme.value, but in the URL for the API call, your template string is using ${mode} and ${colorScheme}, which is not the same thing. I would expect that you should be sending ${mode.value} and ${colorScheme.value} in the template string to build the URL for the API call.