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 5 of 5
  1. #1
    New Coder
    Join Date
    Apr 2003
    Location
    Texas
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    inner.html syntax

    I understand from some other posts that the reason I'm having problems with Firefox displaying a code I have with an inner html reference has to do with syntax.

    Below is a snippet of the code I am using.
    <a onmouseover="info.innerHTML = '&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt; \'And on their way, they met a grey bearded man.&lt;/div&gt;'">Landscaping</a><br>

    Could someone please inform me as to the correct language to use to get this to show up in a div I have set up? I would appreciate it a lot.

    Nevermind, I used some other code I found in another post and was able to adjust it to my needs. Thanks for being here anyways
    Last edited by driftwood; 04-14-2005 at 09:59 PM. Reason: I found out the answer by experimenting with another answered post.

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    any special character you want to use like quotes just do so:

    blah.innerHTML="<br>the boy said, \" blah blah blah\"";


    use the \ infront of the special characters
    and as long as the <>'s are within the quotes of the innerHTML you dont have to convert them you can type just as they are

  • #3
    New Coder
    Join Date
    Apr 2005
    Location
    Burnaby, BC, Canada
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Whats the problem with it? I tried it out, and it seems to work?
    'Programming is the only artform that fights back!'

  • #4
    New Coder
    Join Date
    Apr 2003
    Location
    Texas
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Solution to my problem

    It worked fine in IE, just not firefox. I changed my code to
    <a onmouseover="document.getElementById('info').innerHTML =

    and it works fine in both now.

    Thanks for your comments and help.

  • #5
    New Coder
    Join Date
    Apr 2005
    Location
    Burnaby, BC, Canada
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tried your original code in firefox, and it worked for me.
    'Programming is the only artform that fights back!'


  •  

    Posting Permissions

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