I’m trying to print a div that is currently visible but my jQuery isn’t working properly
Here’s what I’m trying using the printElement plugin
$('.printDirections').click(function() {
$(this).parent().children().('div').is(':visible').printElement()
});
And my HTML looks like this
<div class="directionstext">
<img src="/images/opendays/print.gif" class="printDirections">
<div id="prop1" style="display: none;">
some text
</div>
<div id="prop2" style="display: none;">
some text
</div>
<div id="prop3" style="display: block;">
some text
</div>
</div>
Any ideas what I’m doing wrong?
It looks like your selector is incorrect. You’re probably looking for: