The new way of writing this is:
frappe.ui.form.on("refresh", function(frm) {
frm.toggle_display("occupied_by", frm.doc.item_group=="Pads");
});
Edited to
frm_doc.item_group=="Pads"
However, a shortcut to this is to use Depends On in the Custom/Doc Field occupied_by:
Depends on value should be: eval:doc.item_group==="Pads"