title: Chrome Extension: DOM traversal
body: <p>I want to write a Chrome extension that looks at the HTML of the page its on, and if it finds eg <code>&lt;div id="hello"&gt;</code> then it will output, as a HTML list in the popup, 'This page has a friendly div' and if it finds eg <code>&lt;a href="http://bananas.com"&gt;I am married to a banana&lt;/a&gt;</code> then it will output 'This guy is weird.'</p>
  
  <p>So in other words, searching for specific stuff in the DOM and outputting messages in the popup depending on what it finds. </p>
  
  <p>I had a look at <a href="https://stackoverflow.com/questions/2063015/google-chrome-extension-accessing-the-dom">Google Chrome Extension - Accessing The DOM</a> for accessing the dom but I'm afraid I don't really understand it. Then of course there will be traversing the dom and presumably using regex and then conditional statements. </p>