javascript script innerhtml
- by Sanjay
hi i want to call function changeDivHTML which pass the image
<a href="javascript:void(0)" onclick="changeDivHTML(<img src='.DIR_WS_IMAGES .$addimages_images[$item]['popimage'].'>)">
and the function add this images to particular id's div.
function is 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 images browser showas the 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>)
plsease help how to remove this error.