$('#divID').css("background-image", "url(/myimage.jpg)");
Should do the trick, just hook it up in a click event on the element
$('#divID').click(function()
{
// do my image switching logic here.
});
More Related Contents:
- meaning of console.log(id); id = id.split(" "); [closed]
- How can I get the ID of an element using jQuery?
- Stop all active ajax requests in jQuery
- Difference between $.ajax() and $.get() and $.load()
- What is the easiest way to disable/enable buttons and links (jQuery + Bootstrap)
- How to have click event ONLY fire on parent DIV, not children?
- How to enable CORS in flask
- keypress, ctrl+c (or some combo like that)
- can jqgrid support dropdowns in the toolbar filter fields
- How would you compare jQuery objects?
- How to set cache false for getJSON in jQuery?
- jQuery $(this) keyword
- Accessing functions bound to event handlers with jQuery
- how to prevent blur() running when clicking a link in jQuery?
- override jquery validate plugin email address validation
- adding jQuery click events to dynamically added content
- Getting an empty JQuery object
- Does jQuery have a handleout for .delegate(‘hover’)?
- jQuery ajax inside a loop problem
- Difference between CSS selector and jQuery filter?
- How can one use JQuery to validate email addresses?
- jQuery trigger when 2/3s of div are in viewport
- Can Fancybox be responsive only horizontally for tall content?
- In JQGrid, Is it possible to use different formatter on grouping summary cell other than column formatter?
- Display jquery ui auto-complete list on focus event
- Force a checkbox to always submit, even when unchecked
- Sorting Autocomplete UI Results based on match location
- jQuery Chosen plugin add options dynamically
- Creating templated/persistant header/footer template in jQuery Mobile and PhoneGap
- My Own Like Button: Django + Ajax — How?