Sunday, September 28, 2008

[jQuery] Re: select data in a

ignoring the

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: