我没有 jQuery,我想知道如何使用 vanilla javascript 做同样的事情。有帮助吗?
$('meta[name="csrf-token"]').attr('content')
最佳答案
document.querySelector('meta[name="csrf-token"]').getAttribute('content');
这就是你的做法。
关于javascript - 我怎样才能在 vanilla Javascript 中执行 `$(' meta[name ="csrf-token"]').attr(' content')`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42593178/