Ferhat Demir
Ferhat Demir

Reputation: 1

Links must be opened at new tab

I have a webpage which have buttons on it. I add the buttons with the code block below. How can I add opening links at new tab features to those buttons. Code is like that

var appList = [{
    name: "<small>Clever.com</small>",
    grades: "K-12",
    url: "https://clever.com",
    thumbnail: "clever.png"
  },
  {
    name: "Learning.com",
    grades: "K-12",
    url: "http://login.learning.com/",
    thumbnail: "learning.png"
  }
];

Upvotes: 0

Views: 31

Answers (1)

enriquefada
enriquefada

Reputation: 45

If your code is generating pure HTML use target attribute for the <a/> tag. Example:

<a href="page.html" target="_BLANK">Open in new tab</a>

Upvotes: 1

Related Questions