Make sure element is attached before trying to get value.
Merge branch 'api-1.1' into api-1.2