literals and javascript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

id like to update a literal using javascript in my aspx code i have a
literal with a span
tag as follows:

<td class="mainTitle" style="height:40;">
<asp:Literal ID="litLink" runat="server"
Text=""><span id="spanAdvert"></span></asp:Literal>

my javascript says but nothing happens and the image is not displayed

and ideas

TIA

Stu

funciton test()
{
var objLiteral= document.getElementById("spanAdvert");

if (objLiteral!=null)
{


lcImage="<img border='0' src='test.gif' />";

objLiteral.innerHtml=lcImage;
}
}
 
View source on the generated page in your browser. Make sure that the
"spanAdvert" element actually has the ClientId in the page that you think it
does.
Peter
 
Back
Top