The code is fine, but I get an error when I use "getAttribute - setAttribute"  