Using DOM manipulation methods

Solved
SelOua_2617 Posted messages 8 Status Membre -  
SelOua_2617 Posted messages 8 Status Membre -
Hello;
for the following HTML script:
We want to select the list item included in the <ol> element that has the attribute class = "trois" using querySelector()
Then, we created a new element x as follows:

how to add this element to the <ul> list after the last item?

1 réponse

SelOua_2617 Posted messages 8 Status Membre
 
PS: I found out how to add x at the end of the <ul> list :)
0
jordane45 Posted messages 30426 Registration date   Status Modérateur Last intervention   4 830
 
Hello
So, is your question resolved?
If so, please remember to close the topic.

P.S.: In the future, please use code tags when posting your code on the forum.
Full explanations are available here
https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code
0
SelOua_2617 Posted messages 8 Status Membre > jordane45 Posted messages 30426 Registration date   Status Modérateur Last intervention  
 
Not yet, we want to select the list item included in the <ol> element that has the attribute class = "trois" using querySelector()
0
jordane45 Posted messages 30426 Registration date   Status Modérateur Last intervention   4 830 > SelOua_2617 Posted messages 8 Status Membre
 
The selector should look something like this
 ol > li.trois 


The JavaScript query selector uses the same selectors as CSS.
0
SelOua_2617 Posted messages 8 Status Membre > jordane45 Posted messages 30426 Registration date   Status Modérateur Last intervention  
 
Thank you
problem solved.
0