internet-explorertarget

How to use target="_blank" in IE?


I want to use the target blank in Explorer, but I'm not sure. Please tell me how to fix it.


Solution

  • Do you want to open a link in a new window or tab? You can use target="_blank" according to this article.

    I made a sample according to your comments in the answer. You can input website values into the textbox and it can open it in a new tab in IE:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title></title>
        <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
    </head>
    <body>
        <input type="text" class="pdf-file-url" />
        <a href="#" class="btnZoom" target="_blank">link</a>
        <script>
            $('.btnZoom').on("click", function () { $('.btnZoom').attr("href", $(".pdf-file-url").val()); });
        </script>
    </body>
    </html>
    

    Result: enter image description here