Question

$('#attachment-deletion').cloneNode(true);

IE reports Object doesn't support this property or method

what can I do about this? cloneNode was my solution to IE8 not recognizing jquery's clone method, which it didn't even throw an error about

Was it helpful?

Solution

cloneNode is a native javascript method that doesn't work on jQuery objects, you have decide what to use :

jQuery

$('#attachment-deletion').clone(true);

or plain JS

document.getElementById('attachment-deletion').cloneNode(true);

Edit: You can also Combine Plain JS with jQuery if you need to:

$('#attachment-deletion').get(0).cloneNode(true);
// or
$('#attachment-deletion')[0].cloneNode(true);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top