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? Link to comment https://forums.phpfreaks.com/topic/207088-javascript-img-src-help/ 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. Link to comment https://forums.phpfreaks.com/topic/207088-javascript-img-src-help/#findComment-1082832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.