Skip to content

Tag: loops

vue.js insert block for every 6th loop element

I have offers cards list rendering thru the loop. Every 3rd col (bootstrap) elements i add row div. Now i need to add another col element (banner block) for every 6th element. For render some thing like that: How i can implement that? My code now Answer I would recommend you do less programming in the view an…

How to auto sum dynamic input fields in javascript

I’m trying to make an auto sum. I’m starting with a text input field and a button. Pushing the button ads a new input field. Sum field should get … the sum. I have troubles adding the values in javascipt. Thanks! Answer I think this is what you are trying to do: Check this plunk: http://plnk…

Loop through childNodes

I’m trying to loop through childNodes like this: However, it output Uncaught TypeError: undefined is not a function due to forEach function. I also try to use children instead of childNodes but nothing changed. Does anybody know what’s going on? Answer The variable children is a NodeList instance …