Skip to content

Instantly share code, notes, and snippets.

@pdebelak
Last active August 29, 2015 14:02
Show Gist options
  • Save pdebelak/09e6f27f55463a09113b to your computer and use it in GitHub Desktop.
Save pdebelak/09e6f27f55463a09113b to your computer and use it in GitHub Desktop.
Way to find all elements on a page with a negative text-indent value for Dan Yoachim
function find_lefts() {
var all = document.getElementsByTagName('*');
var left_elements = [];
for (var i=0;i<all.length;i++) {
ti = window.getComputedStyle(all[i]).getPropertyValue('text-indent');
if (ti.match(/-/)) {
left_elements.push(all[i]);
}
}
return left_elements;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment