Ciao, puoi delegare al body l'evento click usando on, nella forma .on(event, selector, handler), quindi passare #cover come selettore.
codice:<!DOCTYPE HTML> <html> <head> <title>Esempio</title> <meta charset="utf-8"> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script type="text/javascript"> $(function(){ $("body").on("click", "#cover", function(){ alert("Hai cliccato cover"); }); $("body").append("<div id='cover'>Clicca<div>"); }) </script> </head> <body> </body> </html>
EDIT: @andrea: scusami, non ho fatto in tempo a vedere che avevi già risposto.


Rispondi quotando