Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Javascript :: set background image URL jQuery 
Javascript :: call json api javascript 
Javascript :: convert an object to an array 
Javascript :: countdown javascript 
Javascript :: hammer js cdn 
Javascript :: react focus 
Javascript :: date js add days 
Javascript :: Print array of objects js 
Javascript :: moment js get french time 20:00:00 
Javascript :: angular loop through key values in map 
Javascript :: ng model on change 
Javascript :: datepicker select date programmatically bootstrap 
Javascript :: looping queryselectorall 
Javascript :: react testing for links 
Javascript :: even or odd in javascript 
Javascript :: spining load react component 
Javascript :: filter parameters in javascript 
Javascript :: adding all elements of an array javascript 
Javascript :: angular go to external url with blank target 
Javascript :: javascript object instead of switch 
Javascript :: image in react jsx 
Javascript :: phone number with dashes 
Javascript :: useroutematch 
Javascript :: condition inner populate mongoose 
Javascript :: axios.filter 
Javascript :: dynamic navigation with subitems 
Javascript :: rock paper scissors js 
Javascript :: next-auth with linkedin provider 
Javascript :: remove all elements of one array from another javascript 
Javascript :: knexjs search uppercase 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =