input去除前后空格

input去除前后空格

			<input
              onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
              nz-input
              placeholder="请输入"
            />

使用onkeyup

在数据中空格还是存在的,但是在输入框不显示,在使用数据时可以在截取下空格

你可能感兴趣的:(用法)