I'm having trouble understanding the use of this.
I have the following structure:
<div id="a" class="clsa">
bbb
</div>
<div id="b" class="clsb">
<span id="bb" clsbb> Conteudo bb </span>
</div>
I wanted to attack any of the elements at the time of reading it. I'm doing it this way and it's working:
$("#a").ready(function() {
//Chamando uma função e passando parametros funcionar normalmente, eu queria poder atacar daqui de dentro este mesmo elemento "#a".
})
Now I wanted to be able to get the span of b by following the same idea as the previous one and attacking this span:
$("#b").ready(function() {
//Chamar o span e atacar ele (fazer alguma coisa, mudar o texto, colocar uma classe)
})
I'm trying this, but it's not rolling. He's calling the document and not this element:
$("#b").ready(function() {
this.text("teste");
})
I'm using this right?
I'm making the call "$ (" # a "). ready (.." right?
Am I going wrong at some point?
If it were to attack it after the page was loaded, just change the ready to load equal $ (document) .ready and (window) .load?
Help me pf