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?
http://
Defa
Not so clean but it doesn't let users remove your prefix
//prefix $(document).on('keyup','#membership_num',function(){ var original = $('#membership_num').val().split(''); original[0] = "0"; original[1] = "2"; original[2] = "0"; original[3] = "1"; $('#membership_num').val(original.join('')); });