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

Just responding to an error message in Chrome's JavaScript console when I tried your script.
Thx! Roger