Updated to support nest markup (<label><input /></label>).