How to change image on dynamic checkboxes?

How to change image on dynamic checkboxes?

Hi,
I'm new to JQuery and would really appreciate some help!
I have dynamic checkboxes which has an icon and image on it (checkbox is hidden)...

  1.  plcUserReq.Controls.Add(new LiteralControl("
  2. <div data-toggle='buttons' style='margin-top:-3px'>
  3.      <label class='btn' for='Lines' style='padding:0px 0px 0px 0px; margin:0px 0px 0px 0px'>
  4.          <input type='checkbox' autocomplete='off' name='chkbx' value='" + UID.ToString() + "'id='chk'"+ UID.ToString() + i.ToString() +"/>
  5.                <i class='btn fa fa-plus-square-o' aria-hidden = 'true'>
  6.                      <img src='http://localhost:3162/images/moderator-red.gif'></i></label></div>"));

I want the image and icon to change on click....when each checkbox is clicked...

This is the script I'm trying with...

  1. $("#chkbx").change(function () {
  2.             if ($(this).is(':checked'))
  3.                 {
  4.                  $(this).prev().find('i').attr('class', 'btn fa fa-check-square-o');
  5.                  $(this).prev().find('img').attr('src', 'http://localhost:3162/images/moderator-red.gif');
  6.                 }
  7.             else
  8.             {
  9.                 $(this).prev().find('i').attr('class', 'btn fa fa-plus-square-o');
  10.                 $(this).prev().find('img').attr('src', 'http://localhost:3162/images/moderator-blue.gif');
  11.             }
  12. });
Nothing happens on click...
Please help! I'm stuck!