Added support for textarea and select elements