Hide the edit button in a dynamic div if it satisfies a condition

Hide the edit button in a dynamic div if it satisfies a condition

I've a dynamic div which contains some information and an edit button.
But, some of these dynamic divs should be editable.

I'm generating all of these dynamic divs from my array of objects, which also holds the data for objects which have type="external".

Each dynamic div will have a class called 'box' and each dynamic edit button has a class called 'edit-btn'.

So, I've a condition like, if in dynamic div the obj.type="external" then it the edit button should be available else it should be hidden.

How do I achieve this?