Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to set the background image URL of an element using jQuery

jQuery('selector').css('background-image'); // gets the image URL
jQuery('selector').css('background-image', 'path/to/image.jpg'); // sets the image URL
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #set #background #image #URL #element #jQuery
ADD COMMENT
Topic
Name
9+9 =