Uncaught TypeError: Cannot read properties of null (reading ‘className’)

I have updated the jQuery version in the application and I am getting an error in the DatePickerComponent with jQuery 3.5.0.here i am getting error on .ClassName; i don’t know what to do about it

else {
  if (myOwnFormat == 'HH:mm:ss' || myOwnFormat == 'HH:mm') {
    var className = document.getElementById("icon_" + pickerId).className;
    $("#icon_" + pickerId).removeClass(className).addClass("hcm-grid_calar_saat");
  }
  return myOwnFormat;
}

enter image description here

enter image description here