How can I add an unremovable prefix to an HTML input field?

前端 未结 16 1432
猫巷女王i
猫巷女王i 2020-12-13 04:23

Using jQuery, how can I add a default value of http:// into an input field that can’t be removed, but that still allows you to type a URL after it?

Defa

16条回答
  •  被撕碎了的回忆
    2020-12-13 04:48

    Material UI Inputs can accept an input adornment prop for prefixes or suffixes:

    https://material-ui.com/api/input-adornment/

    Kg,
          }}
        />
        
          Kg}
            aria-describedby="standard-weight-helper-text"
            inputProps={{
              'aria-label': 'weight',
            }}
          />
    

提交回复
热议问题