dnp76
dnp76

Reputation: 119

Open links in new Window/Tab

I cant seem to figure out how to get the links to open in a new window or tab. Feeling like a total newbie. Any thoughts? Live link: http://wp11004271.server-he.de/alloytoy5.5.1/

        function RenderItem(number, item) {
            if (typeof item != "undefined")
                return "<div class='bit-5'>\n\
                            <a href='" + item.link + "' id='alloy_" + number + "'>\n\
                                 <p class='alloy' >\n\
                                    " + item.name + "\n\
                                </p>\n\
                            </a>\n\
                        </div>";

            else
                return "";
        }

Upvotes: 0

Views: 79

Answers (1)

Darren Wainwright
Darren Wainwright

Reputation: 30747

You just need a target attribute; _blank in this case.

<a href='" + item.link + "' target='_blank' id='alloy_" + number + "'>\n\

You can find the supported values of this attribute here: http://www.w3schools.com/tags/att_a_target.asp

Upvotes: 4

Related Questions