0
Has the following html code:
<div id="lista">
<p>Antonio Carlos Almeida Filhos</p>
</div>
How could I exclude this paragraph only from this div
without deleting other existing paragraphs on the page.
We can use $("p").remove()
,but in that case would be removing all existing paragraphs on the page.
I tried to find this solution, but got lost in relation to css selectors
– edson ferrari
Just follow the order of the html sequence itself. First select the mother div with "#list" then select the child you want to delete "p".
– Luigi Matheus
Ok, in this case also will only remove the paragraphs of the mother div "#list", even if you have other elements
– edson ferrari
Exactly, even if you have millions of "p" in html, you will only remove those within the #list.
– Luigi Matheus
ok so that’s right. Tks
– edson ferrari
@In taking advantage of the similar case, I have the following:
for(i = 0; i < n_conv; i++)
{
 $("#lista").append('<p class="text-dark"> nome</p>');
}
&#I have this onefor
that makes aappend
with paragrafos , I have this classtext-dark
that should make the name bold, but that’s not what happens. If I put it directly into html it works, but if I useappend
doesn’t work. Is there any way to do it that way?– edson ferrari
I believe this is subject for another question friend Edson Ferrari.
– Luigi Matheus
Okay, I still need to get used to the stackoverflow, Tks
– edson ferrari