Try
$(function() { // when DOM is ready $("#showhidecomment").click(function(){ // when
And change your html (part of the link) to
<div> <div id='showhidecomment'>Show Comments</div> <div id='chkcomments'></div> </div>
Since div elements are not allowed inside a elements.
update for comments
I would add a custom data-url attribute to these elements (to indicate the page to load)
<input id="passed" type="radio" value="P" data-url="some-page.jsp" /> <input id="law" type="radio" value="L" data-url="some-other-page.jsp" /> <input id="ac" type="radio" value="C" data-url="some-third-page.jsp" />
and then apply one handler to them
$('#verification').on('change','input[type="radio"][data-url]', function(){ if (this.checked){ var url = $(this).data('url'); $("#chkcomments").load( url ); } });
source share