Zepto support for data-* attributes through .data()

lotor

New Member
I'm using Zepto.js, a lightweight jquery clone. But that framework doesn't use .data() in the same way as jquery. Now I need to use this code:\[code\]var position = new Array;$('#ipadmenu > section').each(function() { position.push($(this).data('order'));});\[/code\]But I have no idea how to make this work on my framework.How would I convert this to pure javascript? I have never really worked with arrays so i'm quite lost... also, might I have skipped something in the zepto doc (https://github.com/madrobby/zepto) that could help me with this? .get() for example?Here is the HTML code. Basically I want to add all sections (the amount can change) into the array:\[code\]<nav id="ipadmenu"> <section data-order="0"> <a><p>text</p></a> </section> <section data-order="1"> <a><p>text</p></a> </section></nav>\[/code\]thank you for your help!
 
Top