spacer
Yehuda Shiran January 10, 2000
Updating Existing Text
Tips: January 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management
Take a look at the following <SPAN> definition:

<SPAN ID="banner" STYLE="position: absolute;"></SPAN>

The ID attribute is similar to the NAME attribute in that it defines the HTML element's individual name. The ID attribute is used to reference the element in JavaScript. In Navigator, document.banner reflects the element, while document.all.banner, or simply banner, represents it in Internet Explorer.

Microsoft and Netscape agree on CSS, but disagree on the object model. Navigator treats a positioned element as a new browser window, so you can write to its document object, whereas Internet Explorer features a property that reflects the element's inner content (innerHTML). The following function sets the content of a specific element:

function display(id, str) {
  if (NS4) {
    with (document[id].document) {
      open();
      write(str);
      close();
    }
  } else {
    document.all[id].innerHTML = str;
  }
}

Learn more about updating an existing text, from Column 3, Rotating Text Banners.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags