Ich mache eine kleine Web-App in Java-Skript, es ist eine einfache App, um Lesezeichen zu erstellen und Websites zu speichern. Ich habe diese Web-App so gemacht, dass sie Links zu Webseiten speichert, aber ich weiß nicht, wie man diese Links anklickbar macht und sie dann in einem neuen Browser-Fenster öffnet.Wie man einen Link öffnet, öffnet ein neues Fenster, wenn in JavaScript und HTML geklickt wird?
dies ist mein Code:
<form class="ui stacked segment form" action="/bookmark/{{bookmark.id}}/addwebsite" method="POST">
<div class="two fields">
<div class="field">
<label>Title</label>
<input placeholder="Title" type="text" name="title">
</div>
<div class="field">
<label>Link</label>
<input placeholder="Link" type="link" name="link">
</div>
<div class="field">
<label>Summary</label>
<input placeholder="Summary" type="text" name="summary">
</div>
</div>
<button class="ui blue submit button">Add Website</button>
</form>
////////////////////////////////// ///////////////////////////////////////////
<table class="ui table">
<thead>
<tr>
<th>Website</th>
<th>Link</th>
<th>Summary</th>
<th></th>
</tr>
</thead>
<tbody>
{{#each bookmark.websites}}
<tr>
<td>
{{title}}
</td>
<td>
{{link}}
</td>
<td>
{{summary}}
</td>
<td>
<a href="/bookmark/{{../bookmark.id}}/deletewebsite/{{id}}" class="ui icon button">
<i class="icon trash"></i>
</a>
</td>
</tr>
{{/each}}
</tbody>
</table>
Warum nicht anklickbar der Link würde lösen, wie es schon ist? Der erste Teil der Frage macht keinen Sinn – charlietfl