Kahn
Kahn

Reputation: 439

Opening link in new tab from Polymer Modal

Hi just a very simple question. I have a Modal in my Polymer 3 page. I want to add a link in the model and open the link in new Tab, but its not working. The link opens in the same window, where the popup is opened?

<html>
  <div class="modal--innerContainer">
     <div>
        <h3>${item.title}</h3>
        <p>${item.content}</p>
        <a href="#" target="_blank">Read more</a>
     </div>
     <button on-click="${() => this._closeModal()}">Close</button>
  </div>
</html>

Upvotes: 1

Views: 431

Answers (2)

V5NEXT
V5NEXT

Reputation: 2077

Please try this

<html>
<div class="modal--innerContainer">
    <div>
        <h3>${item.title}</h3>
        <p>${item.content}</p>
        <a target="_blank" rel="noopener noreferrer" href="http://www.google.com">Read More</a>

    </div>
    <button on-click="${() => this._closeModal()}">Close</button>
</div>

</html>

Upvotes: 4

KamalaH
KamalaH

Reputation: 1401

Try adding this line. It works!

<a href="https://upload.wikimedia.org/wikipedia/en/5/5e/Gothiccover.png" target="_blank">Read more</a>

Upvotes: 1

Related Questions