Re: Tag <p> is created right after text deletion

  •  11-10-2008, 8:05 PM

    Re: Tag <p> is created right after text deletion

    Because some guys ask me how to do! I put here for all!

    Please use it before saving data

    if(str.toLowerCase().indexOf("<p>") == 0)
    {
         str= str.replace(/^<p>/i,"");
         str = str.replace(/<\/p>$/i,"");
    }

    Please use it before pasting data
    if(str.toLowerCase().indexOf("<p>") == 0)
    {
        str = str.replace("<p>","");
        str = str.replace("</p>","");
    }

    Nothing's impossible, Nothing's unreachable.
View Complete Thread