get/set element value - inspired by jQuery .val()