first working version, but uses text attribute instead of innerHTML