How to add a background image to a javascript toggle button?
-
Hi guys,
I’m using WordPress and on one of my category pages i’m trying to allow the user to toggle the visibility of a div at the click of a button. It works perfectly but i would like to add a background image to the toggle button to improve the appearance.
I can’t seem to figure out how to do this. Here is the code that toggles the div ‘journal’, if anyone could have a look at it and help add the background image code i would be very grateful. Thanks.
a href=”javascript:void(0);” onclick=”document.getElementById(‘journal-accordion-sub1’).style.display=(document.getElementById(‘journal-accordion-sub1′).style.display==’none’)?’block’:’none’;” class=”toggle”>Open</a
- The topic ‘How to add a background image to a javascript toggle button?’ is closed to new replies.