In This Javascript Tutorial we will See How To Reverse All <LI> Elements From A <UL> List Using Array And For Loop In JS And Netbeans Editor .

Subscribe :

Project Source Code:

<!DOCTYPE html>
        <title>Javascript: reverse All LI</title>
        <meta charset="windows-1252">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <ul id="list">
            var items = document.querySelectorAll("#list li"),
                 tab = [];
         // populate array with li values
         for(var i = 0; i < items.length; i++){
         // clear UL
         document.getElementById("list").innerHTML = "";
         var list = document.getElementById("list");
         for(var i = 0; i < tab.length; i++){
             var textNode = document.createTextNode(tab[i]),
                 liNode = document.createElement("LI");    

#js #javascript

How To Reverse LI Items From UL List Using Javascript [ with source code ]
5.60 GEEK