Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JamesDBartlett3/2cbe8dcd999f4e51bc14d03544c11b1f to your computer and use it in GitHub Desktop.
Save JamesDBartlett3/2cbe8dcd999f4e51bc14d03544c11b1f to your computer and use it in GitHub Desktop.
Colorized .querySelect() & .getElementsByClass() Examples
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="50" id="getelements">
<text font-size="16" x="10" y="20">
document.getElementsByClassName(<tspan fill="red">\'red test\'</tspan>);
</text>
</svg>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="50" id="queryselector">
<text font-size="16" x="10" y="20">
document.querySelector(\"<tspan fill="red">div.user-panel.main</tspan> input[name=\'login\']\");
</text>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment