0
I want to create a button and the link that open in it is of a div
that is on my site for example in Javaccript
var elemento = document.getElementById('teste').innerHTML;
button2.onclick = function() {
window.open(elemento)
}
the var elemento
receives the URL and when I click on the button opens the element url ('teste').innerHTML
;
How do I do that? This one doesn’t work.
Doesn’t it work? What happens? How did you define
button2
? And what is the value indiv
? By the way, what is the structure of HTML?– Woss
I’m asking how I do it I just gave a silly example
– Minelops Ml
the link that the button opens when you click on it is an element that I put on the page, for example create a div with a url and I want the button link to be the text of the same.
– Minelops Ml
From what you’ve described, your example comes very close to doing what you want. Try to implement based on your example and, if it doesn’t work, edit your question with something more concrete.
– Woss