I write a script that can hide or show my classes by some considered radio buttons, but it does not work at runtime and does not change dynamically, any ideas?
My script:
$(document).ready(function() {
if (document.getElementById('addContent').checked) {
$(".contentForm").show();
$(".searchContentForm").hide();
}
else if (document.getElementById('editContent').checked ||
document.getElementById('deleteContent').checked) {
$(".searchContentForm").show();
$(".contentForm").hide();
}
else {
$(".searchContentForm").hide();
$(".contentForm").hide();
}
});
JsFiddle Demo:
http://jsfiddle.net/BpMed/
Simplified code:
Refer LIVE DEMO