$("p")[0].firstChild;
A bit extended:
$("p").each(function() {
console.log( this.firstChild );
});
would log all the texts from the Ps but not the texts inside the SPAN.
Maybe this helps...
On 28 Sep., 21:51, pedram...@gmail.com wrote:
> Dear MorningZ ,
> I don't want to remove the Span I just want to filter the text before
> the Span ...
> Pedram
>
> On Sep 28, 10:22 pm, MorningZ <morni...@gmail.com> wrote:
>
> > this is TOTALLY untested, but should work
> > $("p").click(function() {
> > var txt =$(this).html();
> > txt = $(txt).find("span").remove().text();
> > alert(txt);
> > );
>
> > On Sep 28, 2:13 pm, pedram...@gmail.com wrote:
>
> > > Hi Guys,
>
> > > this is the Code which I am working on
>
> > > <p>
> > > Data which I need to select and it hasn't an attribute
> > > <span> Data in a Span </span>
> > > </p>
> > > <p>
> > > Data which I need to select and it hasn't an attribute
> > > <span> Data in a Span </span>
> > > </p>
> > > <p>
> > > Data which I need to select and it hasn't an attribute
> > > <span> Data in a Span </span>
> > > </p>
> > > How could FIlter and Select the text Before the <span>
> > > does someone has an Idea ?
>
>
No comments:
Post a Comment