Hello, I am trying to call a function called changeDivHTML which passes an image.
<a href="javascript:void(0)" onclick="changeDivHTML(<img src='.DIR_WS_IMAGES .$addimages_images[$item]['popimage'].'>)">
This function adds the images to a specific ID's div.
The function looks like this:
<script language="javascript" type="text/javascript">
function changeDivHTML(item)
{
alert(item);
previousInnerHTML = 'item';
alert(previousInnerHTML);
document.getElementById('image').innerHTML = previousInnerHTML;
}
</script>
But when I click on the images, the browser shows a JavaScript error.
Error: invalid XML attribute value
Source File: http://xxx.xxx.xxx.xxx:xxx/product_info.php?products_id=31
Line: 1, Column: 23
Source Code:
changeDivHTML(<img src=images/products/top/product_big1.jpg>)
Please help me figure out how to resolve this error.