I'm trying to create a select drop down, which on change, takes the "data-bg" attribute value of the option, and applies it as the body background.
But the background image urls are coming from somewhere in the php script.
so what i need to do is, take a php array of background image urls, and with a for loop, create a jquery function to add the image urls as data attributes to each option in the select input.
one thing is that the 1st option in the list is a blank, so i will need an offset there too.
What jquery function would i be able to use to loop through the option's in a select to apply a data-attr, so i can bind an on change to change the background image.
let me know if you need any clarification.