Set variable by node attribute

Set a variable to the value of an attribute of an HTML element.