Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

Set Background image with jQuery

Hello Friends,

As you know we can set the tag's attributes using jQuery. It can be dynamically change by using jQuery(calling it at some events.(for e.g. onClick, onFocus etc)). If you are looking to set the background image property in div using jQuery than have a look at below jQuery code.

Below is a jQuery code to show background image using jQuery:

$('#id').css('background-image', 'url(image.gif)');

If you find any problem in this than let me know by comment.

To know more about programming,JavaScript issues,jQuery,Expression Engine,MYSQL database and Open-source, enter your email address below. We will send you free tutorials.

Enter your email address:
 
Feel free to ask any question. Just leave your comment below and we will answer your comment with in 24 hours.
Share:

No Comments Yet.

Leave a Reply

Your email address will not be published.