Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在控制台内执行通过文本字段从用户那里获得的 JavaScript,并直接使用 JavaScript 和/或 jQuery 获取浏览器控制台的输出?
您可以为此使用eval:
console.log(eval('('+$('#yourInput').val()+')'))
示范