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
Post a Comment