Skip to content
Advertisement

Javascript converting the URL to an ‘anchor’ tag and store the tag as a string in an array

I’m trying to create an application that will track an web pages and as user add a new URL, the links will appear on the web page below the input box. I want to convert the URL to an ‘anchor’ tag and store the tag as a string in an array. I can get an output but I don’t know how to convert url to and achor tag. This is what I have for html and javascript. Overall, I’m trying to modify the hyper link so that when the user selects a link, the page will appear in a new tab.To enable this, like ‘target=”_blank” within the ‘’ tag.

JavaScript

———javascript————

JavaScript

Advertisement

Answer

Just enclose the radio tag with the a tag while displaying the list

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement