continuously check if something exists and do something
<p>The content on my page is loaded via AJAX (it's a step by step process) and I need to check if a specific div exists.</p>

<p>That specific div appears after few clicks. I have to mention that I don't know the number of clicks.</p>

<p>How can I continuously check if the div exists till it finds it and after it finds it do to something?</p>

<p><strong>Later edit: 
How can I continuously check till a specific div doesn't exist and do something after that. More exactly the div is there, but after a few ajax calls it gets removed.</strong></p>