Maybe you want to do this with plain Javascript:

$("#mydiv")[0].firstChild
or:
$("#mydiv").contents()[0];

but .contents() get all childNodes from every element:
$(".myclass").contents() would get the contents of every matched
element (not like .html() wich only returns the innerHTML of the first
matched element)


On 9 Okt., 22:08, ricardobeat <[EMAIL PROTECTED]> wrote:
> Why exactly do you need that?
>
> You can move elements around without chaning it's code, like in
>
> $('#myId').appendTo('.newposition');
>
> You can also clone it and change all of it's attributes, so I don't
> really see the need to get the elements code.
>
> - ricardo
>
> On Oct 9, 9:39 am, eudesf <[EMAIL PROTECTED]> wrote:
>
> > I know that we can get the INNER html of an element with html()
> > function.
> > And also, we can get the parent() element and return this html()
> > function to obtain the html code of the all children of the parent()
> > element.
> > But, how to get only, and only, the html code of the element that we
> > have?
>
>

Reply via email to