Have an account? Sign in
Login  Register  Facebook
jquery problem with opera and ie and working woth firfox
i\'m trying to make some thing like voting system
i have this jquery code
$(function() { 
    $(\'#vote a span\').click(function(){
        alert(\'working\');
        return false;
    })
;});
and this html code
<div id=\"vote\">
    <a href=\'#\'><span>one</span></a>
</div>   

<div id=\"vote\">
    <a href=\'#\'><span>two</span></a>
</div>   

in firfox when click one its show me an alert this mean its works fine
in ie and opeara its not working can any one tell me why
Started: September 15, 2011 Latest Activity: September 15, 2011 jquery firfox vote opera
1 Answer
id should be unique. Use classes instead!
<div class="vote">
<a href='#'><span>one</span></a>
</div>   

<div class="vote">
<a href='#'><span>two</span></a>
</div>   

and it will work fine

Posted: MacOS
In: September 15, 2011

oh my god!! its worked fine thank you
September 15, 2011

Your Answer

xDo you want to answer this question? Please login or create an account to post your answer