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 2 of 2
  1. #1
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,169
    Thanks
    19
    Thanked 65 Times in 64 Posts

    Changing text in FF.

    Code:
    function setText(){
    document.getElementById("friend").innerHTML = document.getElementById('friendname').value;
    document.getElementById("message").innerHTML = document.getElementById('messageinput').value.replace(/\n/g, '<br />');
    
    }
    works fine in IE, but it FF I get
    Code:
    document.getElementById('friendname') has no properties
    friendname is a span where I want the text to change.

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,467
    Thanks
    3
    Thanked 495 Times in 482 Posts
    mack sure that it has an id

    name will only work for getElementById in IE


  •  

    Posting Permissions

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