readAttribute(element, attribute) -> String | null

Returns the value of element's attribute or null if attribute has not been specified.

This method serves two purposes. First it acts as a simple wrapper around getAttribute which isn't a "real" function in Safari and Internet Explorer (it doesn't have .apply or .call for instance). Secondly, it cleans up the horrible mess Internet Explorer makes when handling attributes.


<a id="tag" href="/tags/prototype" rel="tag" title="view related bookmarks." my_widget="some info.">Prototype</a>

// -> '/tags/prototype'

// -> 'view related bookmarks.'

// -> 'some info.'