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
 
PREVIOUS NEXT
Tagged: #How #set #background #image #URL #element #jQuery
ADD COMMENT
Topic
Name
5+7 =