update .text() to detect input elements and use value instead of innerHTML