I apologize if I didn't understand what you just said.
You cannot have more than one element on the same page with the same
ID. But they can have the same class.

On Mar 2, 11:03 am, David <garcia.narb...@gmail.com> wrote:
> The point is that I am doing something is not suitable at all.
> I've got, for example, #div_1 and #div_2, and on child of each div has
> the same id. That's why I am trying to access it this way
>
> On 2 mar, 21:56, MorningZ <morni...@gmail.com> wrote:
>
> > Does
>
> > $("#anotherId").append(HTML);
>
> > work?
>
> > What about
>
> > document.getElementById("anotherId").innerHTML = HTML;
>
> > ??
>
> > Are *you sure* that variable "HTML" is a valid string?
>
> > On Mar 2, 3:44 pm, David <garcia.narb...@gmail.com> wrote:
>
> > > I am trying to do:
>
> > > $("#oneId > #anotherId").append(HTML);
>
> > > but it doesn't work. On the other hand, next line works:
>
> > > $("#oneId > #anotherId").remove();
>
> > > What works for the first case is:
>
> > > $("#oneId  div[id='anotherId']").each(function(){
> > >         $(this).append(HTML);
>
> > > });
>
> > > I don't understand why "$("#oneId > #anotherId").append(HTML);"
> > > doesn't work.
>
> > > Thanks in advance.
>
>

Reply via email to