Spring form:checkbox jquery event handle -


i use jquery 1.9 , spring 3.1.2. have next code in jsp:

<form:checkbox path="phonebankchannel" /> 

and have next code in js:

function ischeckedbankchannel() {     if ($('#phonebankchannel').is(':checked')) {           alert("show something");     } else {         alert("hide something");     } } 

problem approach not work. works when add id attribute form:checkbox. can me ?

try attribute selector

 $('input[path="phonebankchannel"]').is(':checked')) {  ..... 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -