I have a problem setting a mouseup-event to my javascript created div element.
I have done this:
Code JavaScript:
var my_id = '12';
var my_element = document.createElement( 'div' );
my_element.setAttribute("onmouseup", "speacial_function('"+my_id+"')");

But I can not it get working. Is there some better/correct way do do this. And I think the problem is that I need to get javascript variable emedded into that "special_function".

And of course that onmouseup event works perfectly if I write it statically into the page, but the problem arises when I try to dynamically create more elements with javascript.

Any suggestions?