javascript - Creating a textbox with predefined data -


i facing problem in creating text box email address want filled example: @hotmail.com actual identifier entered user, want in single text box. possible? remember have seen somewhere on websites.

this kind of approach may fulfill need

$('button').on('click',function(){      var name = $('#in').val();      var domain = $('#dom').val();      alert(name + domain);  });
#in{    border-right:0px;    margin-right:0px;    padding-right:0px;   }  #dom{    border-left:0px;    margin-left:-5px;    padding-left:0px;    text-align:right;    width:108px   }  input{    border:1px solid black;  }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>  <input id="in"/>  <input id="dom" readonly value="@example.com"/>  <button>subscribe</button>  <p></p>


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -