0

OK I'm trying a simple anchor tag javascript that will trigger the submit instead of input-submit

here's my JS code

$(document).ready(function() {
    alert('1');
    $( "#vote-poll" ).click(function() {
        alert('2');
        $( "#form-vote" ).submit();
    });

    $( "#form-vote" ).submit(function( event ) {
        event.preventDefault();
        alert('3');

    });
});

Just assume every element is correct because I tried it in Firefox and it's working fine. I tried it in Chrome, it only alerts the "1". I tried it in Chrome on jsFiddle and it worked..

I really don't know whats wrong in this.

Devin
  • 7,690
  • 6
  • 39
  • 54
Roi
  • 503
  • 1
  • 12
  • 25

0 Answers0