literals and javascript

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;
}
}
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top