1
If yes, how? If not, is there any way I can get the title value and then print it? For now it is like this(Inside a function. In the image has an onClick calling the same).
var imagens = document.getElementsByTagName('img');
document.getElementById('legenda').innerHTML = imagens;
I’ve tried for a getattribute too and nothing
Yeah, that’s what I’m talking about! It is that I am trying to do that when an image is clicked, the title of it is printed on an id was trying to do with a getElementById but my doubt was what to put in the result... I tried more or less with what you said and I did not get result, even give "Undefined". Can you tell me how I’m going to be doing this? Thank you!
– Naldson
Can edit your question and include the code you already have? It’s hard to visualize just with what you said.
– bfavaretto
All right, I edited!
– Naldson
@Naldson It’s still not very clear what you’re trying to do, but I edited the answer based on your code.
– bfavaretto
It’s almost that. But with this way that you told me it prints the image that I clicked on. I wanted to print out her title.
– Naldson
document.getElementById('legenda').innerHTML = imagens[0].title;
– bfavaretto