SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to insert quotes in this case?

    Hello,

    I'm trying to change DIV's innerHTML to the link, for example:

    document.getElementById("element").innerHTML = '<a href="#" onclick="show('option');">';
    The problem is I can't use 'option' or "option", because both of them conflicting with other code:
    'option' conflicts with innerHTML = '....';
    "option" conflicts with onclick="....";

    I wonder how can I make it work? Is there any trick?

  2. #2
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Solved. \\\' made a trick.


Bookmarks

Posting Permissions

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