Using DOM manipulation methods

Solved
SelOua_2617 Posted messages 8 Status Member -  
SelOua_2617 Posted messages 8 Status Member -
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 answer

  1. SelOua_2617 Posted messages 8 Status Member
     
    PS: I found out how to add x at the end of the <ul> list :)
    0
    1. jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention   4 831
       
      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
      1. SelOua_2617 Posted messages 8 Status Member > jordane45 Posted messages 30427 Registration date   Status Moderator 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
      2. jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention   4 831 > SelOua_2617 Posted messages 8 Status Member
         
        The selector should look something like this
         ol > li.trois 


        The JavaScript query selector uses the same selectors as CSS.
        0
      3. SelOua_2617 Posted messages 8 Status Member > jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention  
         
        Thank you
        problem solved.
        0