attributes[i].nodeValue is deprecated, change to .value