The old code only creates this div if altNote is truthy. You're creating it and appending it unconditionally.  I'm guessing that's a mistake.