J0k3R^
  • *****


      Reputation : 11
      Registered on : 2014-04-25
      Posts : 153
      Love Fmcodes
    Hi, i have a problem with a replacement in a javascript code.

    The javascript code is this one:

    Replace text in javascript 8td4x83

    u see that the second line 
    Code:
    .replace(/HTML/g,"<span id='HTML'>HTML</span>

    With this code, the text "HTML" is getting replaced by second word "HTML" which is in the span id.
    I want to replace the text "[HTML]" (without quotes). I tried this one:
    Code:
    .replace(/[HTML]/g,"<span id='HTML'>HTML</span>

    but something is not correct so i get this result:
    Replace text in javascript T4jDzIV

    which is the correct code in order to replace 
    Code:
    [HTML]



    ??

    J0k3R^
    • *****


        Reputation : 11
        Registered on : 2014-04-25
        Posts : 153
        Love Fmcodes
      okey guys i have found the solution and u can lock the topic.

      Code:
      replace(/\[HTML\]/g

      ddoesmc
      • Support Moderator

          Reputation : 9
          Registered on : 2014-03-11
          Posts : 299
          Helping on the forum
        Hello

        as this topic is solved it is locked and moved to the sub-section Solved issues

        Thanks,
        and hope to see you soon again on fmcodes



        FMCodes Support Moderator

        I am very active now! Feel free to PM me anytime.