Get index of item in a loop to be used in if statement to get value in another object

I’m trying to use the index of the current item in a loop to grab a value from a parent object, I’m only able to get the data if I put the number directly in. However, I need to use the index instead. So Parent object contains Library, Books and Book prices Any ideas/suggestions how I can use the index or even the ID attribute of the current item in the loop to get the value Dollars using [ ] would be appreciated. Answer Something like this?

How to export a HTML table to Excel supported by Chrome and IE?

On my MVC project I have a HTML table bound with Knockout. I’m trying to Export the table to Excel. I tried on client side with JavaScript: OR: But both codes work in Chrome but not in IE. I would like to do it on client side using JavaScript or jQuery but if there is not a solution that is supported by both browsers I can also do it in server side with an AJAX Post Request to my Web API. How can I export a HTML table to Excel supported by Chrome and IE using JavaScript/jQuery OR AJAX and