View Single Post
  #2 (permalink)  
Old January 20th, 2004, 05:12 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If you don't want to use textboxes then have a div in the page with the id 'divMessage' then a function such as:
Code:
function showMessage(Html, Append)
{
  var oDiv = document.getElementById("divMessage");
  if (Append)
  {
   oDiv.innerHTML += Html;
  }
  else
  {
    oDiv.innerHTML = Html;
  }
}
to call use:
Code:
showMessage("<b>Hello</b>");
to clear the display and show an enboldened 'Hello', use:
Code:
showMessage("<i>World</i>", true);
to add an italicised 'World'.

--

Joe
Reply With Quote