Is this node replacement code reasonable?
From a once over;


i and f, even for forEach are not very good names, pick something more meaningful.
if data-id is the action id, perhaps you could have gotten/set it with $().data('actionId') ?
The way your replacement function uses OldDiv and RepDiv smells like global variable abuse
Consider using smallCamelCase, actionid -> actionId, OldDiv -> oldDiv
Consider caching $(f), since you access it several times ( var $f = $(f); and then only access $f )
This : $(f).css('cursor', 'pointer'); really belongs in .css file


Other than that, your code looks okay to me.