0
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 am doing this way and this 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 wish I could take the span of b following the same idea of the previous one and attack this span:
$("#b").ready(function() {
//Chamar o span e atacar ele (fazer alguma coisa, mudar o texto, colocar uma classe)
})
I’m trying with this, but it’s not rolling. It’s calling Document and not this element:
$("#b").ready(function() {
this.text("teste");
})
I’m wearing the right one?
I’m making the call "$("#a"). ready(.." right?
I’m making a mistake somewhere?
If it was to attack it after q the page was loaded just change the ready to load equal $(document). ready and (window). load?
Help me with
Can you explain what you mean by
atacar
? Also explain what you want to do with this text so we can help better.– Sergio
tried with
$(this)
instead ofthis
?– BrTkCa
It seems to me that attacking means manipulating.
– Pagotti
In which country is this expression used
atacar
?– gpupo