Javascript function that convert HTML to plain text