خرید بک لینک

Vote count: 0

I want to use jQuery to manipulate a cloned element that is not on the DOM, to perform actions like .remove() on it. Say I have the following code:

var div= $('<div> <div id="div1"></div> </div>');
div.remove('#div1');
console.log(div.html());

The result on the console will still show that the element was not removed. string manipulation is not desirable, I'm looking for something analogue to $().remove()

asked 1 min ago

1 Answer

Vote count: 0

Using the context argument of the jQuery() function:

$('div', div).remove('#div1');

answered 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 4 فروردين 1395 ساعت: 5:32

صفحه بندی