is it possible to get the values from browser console and display the result in browser UI?

Let say i created a 3 different function , when user enters
myFunc(5)
myFunc(5)
in browser console, the output of it should be displayed in the UI. Is it possible?
4 Replies
Jochem
Jochem12mo ago
I doubt it, there's probably some security implications there. It's also bad practice to tell people to use the browser console, it's very easy to get your accounts stolen if you follow random people's instructions to open the console and type stuff there, so it's best to treat it like it doesn't exist and not get users used to using it
Avinash
AvinashOP12mo ago
i wanted to know if that could be acheived cause we use window.addEventlistner , so i though browser console would be the same as input textbox
Jochem
Jochem12mo ago
it's not you can run code a user enters into a text box with eval and get the result of that code being run, but that's also got security implications you should read up about
get out...!
get out...!12mo ago
use the prompt() function or input type text
Want results from more Discord servers?
Add your server