out.println("<html>");
out.println("<head>"
+ "<script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js\"></script>"
+ "<script>"
+ "$('input[type=\"checkbox\"]').on('change', function(){$('input[type=\"checkbox\"]').not(this).prop('checked', false);});"
+ "</script>"
+ "</head>");
out.println("<body>");
I want to check only 1 checkbox at a time and would like to use this script to do that. The script itself is working, however in the servlet it isn't.
How can i add this script to the servlet?