Append div using attribute in jquery

hi guys how may in append div into another div using another div attributes; someone help me using jquery or javascript;
Deepak Sharma
Asked 11-04-2024
87

Answer (1)
hello; Answer: Use the jQuery attr() method for example: $('div2[data-id="230"]').addClass('error'); $('div2[data-id="230"]').append('<div id="450" class="success">Added</div>'); $('div2[data-id="230"]').removeAttr('data-id'); hope its use full to you
Ankur Rajput
Asked 31-12-2019
45 Likes
Comments
Write comment

Submit your answer