views:

118

answers:

2

Hi All I have a div section in which i have an image whose onlick event should execute a function called in it, but it is not executable in FF or chrome with my code, infact the image is not clickable at all . Could some one help me in get the thing done? below is the code i am working with

<div class="addtocart-popup-bg">
        <div class="addtocart-popup-link">
            <ul>
                <li class="col1"><img src="images/categorypage/folder-icon.gif" width="62" height="50" border="0" /></li>
                <li class="col2">
                Submit Print Ready File
                <p>Upload your ready to print file/artwork.</p>
                </li>

                <li class="col3"><img src="images/categorypage/start-order-now-btn.gif" width="134" height="29" border="0" title="Start Order Now" alt="Start Order Now" style="cursor:pointer" onclick="<?php echo "javascript:gotoCat('1');" ?>"/></li>
</ul>
</div>
</div>
+1  A: 

You wrote that the image is not clickable. Did you mean, that the assigned cursor did not appear?

In that case I think it's a problem of CSS, there seems to be something hidden in front of the image.
You can use firebug as well to find out what it is.

Dr.Molle
A: 

I tested your code on Firefox 3.6.10/Ubuntu 9.10, after prepending

<html>
<head>
    <title>Test onClick()</title>
    <script type="text/javascript">
        function gotoCat(n) { alert("gotoCat(" + n + ")"); }
    </script>
<body>

and appending </body>.

It works as intended.

Edgar Bonet