title: Get all Attributes from a HTML element with Javascript/jQuery
body: <p>I want to put all attributes in a Html element into an array:
  like i have a jQuery Object, whichs html looks like this:</p>
  
  <pre><code>&lt;span name="test" message="test2"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>now one way is to use the xml parser described <a href="https://stackoverflow.com/questions/1705504/javascript-jquery-how-do-i-get-an-array-of-all-attributes-in-an-xml-element">here</a>, but then i need to know how to get the html code of my object.</p>
  
  <p>the other way is to make it with jquery, but how?
  the number of attributes and the names are generic.</p>
  
  <p>Thanks</p>
  
  <p>Btw: I can't access the element with document.getelementbyid or something similar.</p>