Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    How can I universally (i.e., in IE and Moz) change the text in a layer? All I know of is innerHTML, and IIRC that's for IE only.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  2.  

  3. #2
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    it isn't just for IE.

    You can use innerText or innerHTML like so...
    Code:
    document.getElementById('spanid').innerHTML = "";
    document.getElementById('spandid').innerText = "";
    JR

  4. #3
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Yeah, innerText should do it

  5. #4
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    A neat way to figure out the properties of a certain element and its differences between browsers is to code something like so:

    Code:
    <div id="div1" class="div1">
     ... div content ...
    </div>
    <script type="text/javascript">
     var ele = document.getElementById("div1");
     var win = window.open();
     var wind = win.document;
     for (x in ele) {
      wind.write("<font color=red>"+x+"</font>, ");
    }
    </script>
    and you can even use it for further properties like [minicode]for (x in ele.currentStyle)[/minicode]
    - Brian


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:19 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com