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
6 Respuestas
+ 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
+ 3
eval() or new Function()
https://www.sololearn.com/post/97586/?ref=app
https://code.sololearn.com/WKKkpq0efxai/?ref=app
+ 1
eval(js.innerText)
+ 1
eval(js.innerText)
0
Gordon nice answer, but how could I use it to solve the issue at hand?
0
Gordon I'm getting an undefined error