Added check for element type to use el.val() for textareas and input texts