JSFiddle - React, Tailwind, and code Playground
by richardneililagan
HTML
<div id="links">
<a href="http://richardneililagan.com">Test Link</a><br/>
</div>
Link to : <input type='text' /><input type='button' value=' Add ' />
CSS
#links {
margin: 20px 0;
}
JavaScript
jQuery(function($){
// make outgoing domains behave like we want to
$('a').not('[href*="google.com"]')
.attr('target','_blank')
;
// ////////
var $links = $('#links'), $tb = $('input:text');
$('input:button').click(function() {
$links.append($('<a>').attr('href',$tb.val()).text('Test Link'))
.append('<br/>');
});
});