Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    germany
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hot to replace this

    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

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i am kind of new to css but this should work, just put it under your body
    Code:
    <style>
    P: {MARGIN: 0cm 0cm 0pt}
    </style>
    that should apply that stle to all <p> but i am not sure about the class thing. (or mine for that matter)

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •