Could someone tell me what I should do to select the "remove" class button in the DOM tree? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Could someone tell me what I should do to select the "remove" class button in the DOM tree?

Context: through Jquery, 1- created a <li> tag and inserted a small text in it - using: var list = $("<li></li>").text("abc"); 2- created and attached a "remove" class button to <li> in order to remove it - using: $(list).append("<button class='remove'>X</button>") (ie: the button serves to remove this <li> from the ol_list); 3- Attached the <li> tag to a <ol> list - using: $(ol_list).append(list); Now I need to select this button in the DOM tree to create the respective event, but since I tried so far, nothing worked; Only when I used the asteristic (selecting all elements of the tree) was the element recognized; Conclusion: It is detectable in the tree, but I don't know how to access it specifically. I thank you in advance for your cooperation;

28th Aug 2019, 10:18 PM
Roger J G Gamito
Roger J G Gamito - avatar
1 Answer
0
.remove
29th Aug 2019, 12:38 AM
Gordon
Gordon - avatar