Intelligently set an attribute on an HTMLElement
The HTMLElement to set an attribute on
The name of the attribute to set
A value to set as the attribute
The behavior of this function is based on the type of val being set.
val
null
false
true
Intelligently set an attribute on an HTMLElement