title: Selenium RC: How to check if an element has a given attribute?
body: <p>I have some buttons with an <code>onclick</code> attribute and some that don't. I want to check if the specified element has the <code>onclick</code> attribute. How can I do this?</p>
  
  <p><code>getAttribute()</code> returns the attribute value when it has one. When it doesn't, it throws a RuntimeException and stops the test (even when I wrap it in a try/catch block).</p>
  
  <pre><code>$onclickValue = $this-&gt;getAttribute("$locator@onclick"); //works when the attribute exists
  </code></pre>