html - Radio button jQuery change doesn't work -


sorry if repost, i've looked around , cannot find solution works.

i have radio buttons, , want execute function when changed. other posts thought should work

$(function() {     $("#ismale").change( function() {         alert("test");         location.href = 'http://google.com'     } }); 

http://jsfiddle.net/bfmyf/1/

but doesn't, can ?

the selector wrong, need close .change function brackets too:

$(function() {     $("input[name=ismale]").change( function() {         alert("test");         location.href = 'http://google.com';     }); }); 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -