Attributes checking in JavaScript

hasAttribute
Задание 1

Given an element:

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

Check if it has the value attribute.