Skip to content

Instantly share code, notes, and snippets.

@edward-hsu-1994
Created February 14, 2019 06:43
Show Gist options
  • Save edward-hsu-1994/c499c5241f07d8ecfe8937865f2fcb56 to your computer and use it in GitHub Desktop.
Save edward-hsu-1994/c499c5241f07d8ecfe8937865f2fcb56 to your computer and use it in GitHub Desktop.
var m = /\[t\:[^\]]+\]/g;
var temp= [];
var origin_temp = document.querySelectorAll("*");
for(var i = 0 ; i < origin_temp.length ; i++ ){temp.push(origin_temp[i]);}
temp = temp.filter(x=>x.children.length == 0).filter(x=>m.test(x.innerHTML));
console.log(temp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment