Custom node's toDOM not updating the node's related dom element attribute

i wasn’t the first who did that , i was inspired by this example which i picked from this thread. And BTW , if the nodes are immutable then why we can pass attrubutes in the toDom returned array ?!