Con el manejo de eventos en contenido agregado dinámicamente, uso:
$('#static-div').on('click', '.dynamic-content', function () { // do something });¿Qué debo hacer si quiero agregar un .not() a este código? Como en, quiero hacer clic en cualquier cosa con ". contenido dinámico" pero no aplicar el manejo de eventos a ". no se debe hacer clic"
Agregar :not() al selector
$('#static-div').on('click', '.dynamic-content:not(.no)', function () { console.log('clicked') }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div id="static-div"> <button type="button" class="dynamic-content">Y</button> <button type="button" class="dynamic-content no">N</button> <button type="button" class="dynamic-content">Y</button> <button type="button" class="dynamic-content no">N</button> </div>