print a dynamically created element jquery
I've some dynamically created elements with jQuery:
<body>
<a href="#" id="trigger">test</a>
<a href="javascript:window.print()">print</a>
</body>
and the jquery:
$(document).ready(function() {
$('#trigger').click(function(e) {
$('body').append('<div id="test"></div>');
});
});
and the css:
#test { position: absolute; left: 50px; top: 100px; width: 500px; height:
25px; background-color:#F00; }
as you can see I've created a print button print and would like to print
out that #test. Unfortunately the sheet only has the two buttons. It seems
that you can't print out dynamic elements.
Any help is much appreciated.
No comments:
Post a Comment