View Full Version : hot to replace this

10-25-2002, 12:03 PM
how to replace <P some text here> with the <P> tag.

actually I want to replace
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">
with a <P> tag.

and how to replace </B> to [/b] globally

var b = /</B>/g;
I could make this pattern is there any way to do this.

thank u

10-25-2002, 02:33 PM
i am kind of new to css but this should work, just put it under your body

P: {MARGIN: 0cm 0cm 0pt}

that should apply that stle to all <p> but i am not sure about the class thing. (or mine for that matter)

10-25-2002, 04:07 PM
Well, to do a replacing on a string of HTML would rougly go like this

var htmlStr = "<b>Hello</b> World!";
psuedoStr = htmlStr.replace(/<(/)?b>/g, "[$1b]");

psudeoStr *should* contain "Hello World!";

This what you are after?