1

I am putting this question along with the solution. I couldn't find a proper solution to this problem so I figured out my own. Hope it helps someone. Lets assume we set a default value "https://" in the input field on focus. Length of https:// is 8. So we will just make a selection from 8th position to 8th position just to fool IE.

$("input").focus(function () {
        if ($(this).val().length <= 0) {
            $(this).val("https://");
            $(this)[0].setSelectionRange(8, 8);
        }
    });

Do this and you are good to go.

A_ehsaan
  • 23
  • 3
  • Thanks for posting the solution here. But it could be better you post it as an answer and mark it as an accepted answer. It can help other community members in future in similar kind of issues. Thanks for your understanding. – Yu Zhou Oct 22 '19 at 07:54

0 Answers0