Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 512 Bytes

File metadata and controls

21 lines (18 loc) · 512 Bytes

读狼叔 nodejs 学习笔记

临时工具

function getAllContents(tag = '.content') {
  // 看书工具函数
  let arr = document.querySelectorAll(tag)
  let contents = []
  for (let i = 0; i < arr.length; i++) {
    const item = arr[i]
    contents.push(item.textContent)
  }
  const str = contents.toString()
  // console.log(str,'i')
  console.log(contents.join('\r\n'), ':以上为获取的全部内容')
}