"Value" isn't recognized as "Value" but string

I want to replace a certain term into other terms and give a link which I input.
For that, I made these components and wrote code like this picture.
However, the words “textinput30.valuue” and “urlinput30.value” aren’t recognized as value, but as just string.

Could you tell me how I should fix my code?

Jumpei.

Hi there! By including the textinput.value reference inside of the string, that is recognized as a literal string. You’ll need to escape back out of the string by closing off the part before the text input with another quote, so that would be more like:

body30.value.replace(“$1”,’<a href=“‘ + urlinput.value +’” target = “_blank” >’ + textinput.value + ‘</a>‘)

You’ll also need to use the single quotes to contain the double quotes as literal strings

Hi Alex!!

Thank you so much!!
I made it ^^

Jumpei.

1 Like