Attributes checking in JavaScript

Given an element:

<input id="elem" value="text">

Check if it has the value attribute.

enru