首页 > 解决方案 > 如何查找具有类“值”的元素,并在以下页面中告诉我们该元素包含的内容 https://theplan.co.uk/support-applicant/

问题描述

我似乎很难通过以下链接回答这个问题:https ://theplan.co.uk/support-applicant/

标签: javascript

解决方案


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"

推荐阅读