My problem is as follows.
I have two or more divs on my page and want to automatically call a function for them by loading the page in question. And at the same time I call these functions I want to pass some parameters so that they are handled in js and returned.
I'll try to explain it some other way.
<div id="a" class="" teste('lala')>
<span></span>
</div>
<div id="b" class="" teste('papa')>
<span></span>
</div>
<div id="c" class="" teste('caca')>
<span></span>
</div>
<div id="d" class="" teste('baba')>
<span></span>
</div>
function teste (parametro){
var parametro = parametro;
/* Preciso neste momento pegar a div que esta chamando a função e atribuir o valor passado para a sua respectiva div. Isso é possível? */
}
Summarizing what I need you to help me: - Make the div call the function when loading the page, I wanted to use onLoad, but it only works for the body - Recognize the div that is calling the function and assign the parameter to some daughter of it (in this example to span).
Remembering that all js will be in an external file.
Who can help me, thank you.