javascript - 如何查找具有类“值”的元素,并在以下页面中告诉我们该元素包含的内容 https://theplan.co.uk/support-applicant/
问题描述
我似乎很难通过以下链接回答这个问题:https ://theplan.co.uk/support-applicant/
解决方案
Two possibilities that come to mind immediately:
querySelector
and getElementsByClassName
Like @Totati, I would also prefer the querySelector.
document.querySelector('.values').innerText
// output: "Obsessing over our users"
elem = document.getElementsByClassName('values')[0].innerText
// output: "Obsessing over our users"
推荐阅读
- powershell - Powershell while循环
- php - CodeIgniter 扩展 CI_URI 未定义方法
- r - 在 r 中使用 print 时删除前括号
- javascript - 仅第一次选择不添加 CSS 的下拉菜单
- java - 单击时更改负按钮的颜色
- wordpress - 将 Wordpress 订阅链接到 Microsoft Dynamics 和点击维度
- javascript - 有没有办法使用 Angular 将任何视频文件上传到 Dropbox?
- directory - 如何在 Code::Blocks 中有一个 Headers 文件夹?
- mysql - 如何让 Express 仅在返回 mysql 查询结果后呈现 HTML?
- npm - 如何将 npm-shrinkwrap.json 转换为 package-lock.json 文件?