I have used the below JavaScript code to get the parameter from the URL and checked the input field. It is working fine if I don't use name="community[]"
third bracket in my input field. If I used third bracket in JavaScript code then it is not working.
html
<input type="checkbox" id="type" name="community[]" value="<?php echo $comvalue;?>">
JavaScript
var i = document.location.href.lastIndexOf('?');
document.location.href.substr(i+1).replace(/community=/g,'').split('&');
$('input[name="community"]').prop('checked',function(){
return $.inArray(this.value,types) !== -1;
});