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

前端 未结 16 1427
猫巷女王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 05:05

    Pure CSS based solution we did make div wrapper and span input combination, please do refer follows

    .lable {
      background-color: #dedede;
      width: 50%;
      padding: 15px;
      border: 1px solid #FF0000;
      -moz-border-radius: 5px;
      border-radius: 5px;
      padding: 5px 5px;
    }
    .snehainput {
      background-color: #dedede;
      border-left: 1px solid #000000;
      border-right: 0px;
      border-top: 0px;
      border-bottom: 0px;
      padding: 2px 5px;
      color: #666666;
      outline: none;
    }
    971

提交回复
热议问题