At this moment, any input entered by the user in the text box and then clicked on the button is dynamically displayed inside anchor tags, each in a new line.
Here's the HTML code for the text box and the button:
<input type="text" name="inputText"><br>
<tr>
<input type="button" value="ADD" ng-click="$ctrl.addtext()">
</tr>
<div id="outputDiv"></div>
Below is the JS function being used:
ctrl.addtext = function () {
var div = document.getElementById('outputDiv');
div.innerHTML += "<a href='' style='margin-left:10px'>"+newtext+"</a><br>";
}
Now, is there a way to include a close or remove button (such as an X) at the end of each dynamically generated anchor tag, that when clicked, removes that specific row only?