Issue #3238868 by ahsannazir, smustgrave: Refactor some uses of the jQuery parents function to use vanillaJS
mentioned in commit a6a7fdba