Implemeneted ModifyAttribute handler to update DOM elements.

Rebased from #4197.