how can make the 3rd textarea to function as a js box? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how can make the 3rd textarea to function as a js box?

I'm working on a HTML editor, I have been able to set the first to HTML, and second box to CSS , but the third one is a heck https://code.sololearn.com/WyeH5OQ7HwGu/?ref=app

9th Jun 2020, 3:31 PM
Lucky victory
Lucky victory - avatar
6 Answers
+ 1
You got to wrap your js in a script tag as you did with the CSS and the style tag. But for some reason, you have to escape the backslash. This should provide the results you're looking for. "<script>"+js.value+"<\/script>" https://code.sololearn.com/Wu33IvwMLvX1/?ref=app
10th Jun 2020, 4:24 PM
ODLNT
ODLNT - avatar
+ 1
eval(js.innerText)
10th Jun 2020, 12:33 AM
Gordon
Gordon - avatar
+ 1
eval(js.innerText)
10th Jun 2020, 12:33 AM
Gordon
Gordon - avatar
0
Gordon nice answer, but how could I use it to solve the issue at hand?
9th Jun 2020, 3:38 PM
Lucky victory
Lucky victory - avatar
0
Gordon I'm getting an undefined error
10th Jun 2020, 6:07 AM
Lucky victory
Lucky victory - avatar