MDanz Posted July 8, 2010 Share Posted July 8, 2010 i pass this to a div innerhtml from javascript. when i do it like this it doesn't work. it should display an image hyperlink var newtext4=("<a href=" + number + "><img src=" + newtext2 + " /></a>"); if i do just text, it displays a hyperlink. var newtext4=("<a href=" + number + ">" + newtext2 + "</a>"); any idea why? Quote Link to comment Share on other sites More sharing options...
trq Posted July 8, 2010 Share Posted July 8, 2010 Both examples would produce invalid html. var newtext4 = '<a href="' + number + '"><img src="' + newtext2 + '" /></a>'; If that doesn't work we need to see where newtext2 is defined. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.