I am working in JavaScript and i want to select an element from an array, and insert into the css that element.But it's not working.What's wrong with it?
function touch(index) {
var images = ["Data\Images\heroim-banner.png", "image3.png", "image1.png"];
var page = $('#page');
if (index == 0) {
page.css('background-image', 'url(' + images[0] + ')');
}
if (index == 1) {
}
if (index == 2) {
}
}