I want to load an image background inside a specific div instead of <img src=""> tag using Javascript.
As it is now the code with the <img/> tag is:
item.prepend($('<img/>', {src: file[options.baseUrlAttribute] + '' +file[options.pathAttribute]}));
I tried something like that:
item.prepend($('<div style="background:url('file[options.baseUrlAttribute] + ''
+file[options.pathAttribute]}')no-repeat center center / cover"></div>' ));
But it doesn't work and returns an error.
What is the correct syntax to make it work?