javascript script innerhtml

Posted by Sanjay on Stack Overflow See other posts from Stack Overflow or by Sanjay
Published on 2010-05-14T11:14:40Z Indexed on 2010/05/14 11:24 UTC
Read the original article Hit count: 244

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about innerhtml