jQuery callback if element found
<p>I have tried the following code:</p>

<pre><code>$('a.buildMenu').click(function (event) {

                    // Prevent normal behaviour
                    event.preventDefault();

                    // Stops it bubbling to the document
                    event.stopPropagation();

                    var link = $(this);

    $(document).find('div#' + $(link).data('id'), function() {

                            console.log($(link).data('id'));
                            $('.buildMenu').removeClass('selected');
                            $('.menu').remove();
                            return false;
                        });
</code></pre>

<p>Which basically means if a div with an id that matches the value of <code>data-id</code> on the clicked link then run the code. However the find method has no callback. How would I do this?</p>

<p>Thanks</p>
