Results 1 to 2 of 2
  1. #1
    newsung is offline Member
    Join Date
    Jul 2012
    Posts
    1
    Rep Power
    0

    Default JavaScript replace() Method

    Please help me to replace HP with HP="blue" in JavaScript replace() Method

    Example
    Before => HP
    After => HP="blue"

    My Source Code
    st = st.replace(/HP/,"HP="blue"");

    If not have quotation marks it's ok. But I would like to replace with it (HP="blue")

    Thanks you very much.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: JavaScript replace() Method

    You'll first need to study up on just what JavaScript is and what it isn't. For one, it isn't Java, and you're asking this question in a Java forum. I suggest you Google for a JavaScript forum and ask this there. Locking this thread as it has nothing to do with this forum.

Similar Threads

  1. ---HELP (replace method)---
    By Zitro in forum New To Java
    Replies: 3
    Last Post: 02-04-2012, 12:53 AM
  2. [SOLVED] calling javascript from applet method
    By shwein in forum Java Applets
    Replies: 5
    Last Post: 11-01-2008, 04:45 PM
  3. Using a replace method...
    By paul in forum New To Java
    Replies: 2
    Last Post: 08-07-2007, 04:50 AM
  4. problems with replace method
    By cecily in forum New To Java
    Replies: 1
    Last Post: 08-02-2007, 09:11 PM
  5. String replace method
    By venkata.tarigopula in forum Advanced Java
    Replies: 1
    Last Post: 07-10-2007, 08:14 PM

Posting Permissions

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