if setting element properties, cast undefined to null, which doesn't display anything in input values at least