var a = $(document).appendChild($('esto')); a.onclick=function(){this.style.color=$('aquello').style.color;}