Article

Arrays in webflow

https://cdn.jsdelivr.net/npm/[email protected]/dist/js.cookie.min.js
Copy to clipboard

We can use our colours array to change the text color of names in our webflow list. We use a forEach() function to loop through every color in the array. We also add index and item to our function so that we can directly refer to the current color and its index during the loop. We use Jquery's .eq(index) function to choose the current https://raw.githubusercontent.com/finsweet/jqueryCourse/main/arrays/ex7.js?actionable=true

<script>
$(document).ready(function(){
  XT1
});
</script>
Copy to clipboard
Send to Live Demo

Live demo

<div id="minidivpage" class="example-live"><h4 class="heading-4">Names in a webflow list:</h4><ul role="list" class="list"><li>Peter</li><li>John</li><li>Brian</li><li>George</li></ul></div>

<script>    
$(document).ready(function() {
  XT1
});
</script>
<script>
  
</script>
Copy to clipboard
Press the Run Demo button to execute the scripts above.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Your browser is too small

Resize your browser to be at least 769px wide.