I'm using print.js v1.6.0 to print a NodeList object directly like below:
const list = document.querySelectorAll('.className');
printJS({
printable: list,
type: 'html'
});
However, I'm still getting the error "Invalid HTML element id: [object NodeList]" when trying to print.
I've tried:
Upgrading print.js to the latest v1.6.0
Getting NodeList via different methods like getElementByTagName
Simplifying the NodeList to just one element
Printing different types of elements like div, p etc.
But the issue persists. As per the v1.6.0 documentation, print.js should support directly printing NodeList without converting to array.
Could you please help look into this issue? Let me know if any other details are needed. Any help would be greatly appreciated.
Content:
Dear author,
I'm using print.js v1.6.0 to print a NodeList object directly like below:
However, I'm still getting the error "Invalid HTML element id: [object NodeList]" when trying to print.
I've tried:
Upgrading print.js to the latest v1.6.0 Getting NodeList via different methods like getElementByTagName Simplifying the NodeList to just one element Printing different types of elements like div, p etc. But the issue persists. As per the v1.6.0 documentation, print.js should support directly printing NodeList without converting to array.
Could you please help look into this issue? Let me know if any other details are needed. Any help would be greatly appreciated.
Thank you!