0
how I would do for when I click on a certain link for example <a href='javascript:void(0)'>Capitulo</a>
display in a textarea
the tags <strong></strong>
, among other link’s that I’ll have to display different tags
document.addEventListener("DOMContentLoaded", function() {
var els = document.body.querySelectorAll("a[href*='java']");
for (var x = 0; x < els.length; x++) {
els[x].addEventListener("click", function() {
var a_txt = this.textContent,
inpt = document.body.querySelector("#versiculos");
inpt.value += " " + a_txt;
});
}
});
<ul>
<li><a href="javascript:void(0)">Capitulo</a></li>
<li><a href="javascript:void(0)">Versículo</a></li>
<li><a href="javascript:void(0)">Destaque</a></li>
<li><a href="javascript:void(0)">Link's</a></li>
<li><a href="javascript:void(0)">Quebra de linhas</a></li>
</ul>
you’ll have to give more context (html and explanation) so you can understand what you want to do
– MoshMage
when clicking on Chapter, it prints in a textarea the tags <Strong></Strong> , and so for each link, each link corresponds to a different tag
– goio