I've found quite a bit on how to solve this problem, but I can't seem to get it working. I want to use an image that has the functionality of a button. The following code works well, but is neither great style, nor will it be able to switch the image it uses.
<input type="image" id="mToggle" src="images/chevronright.jpg" width="48" height="48"></input>
I should be able to do something like the following:
HTML
<input type="image" id="mToggle" class="right" width="48" height="48"></input>
CSS
.left{
background-image: url("images/chevronLeft.jpg");
}
.right{
background-image: url("images/chevronRight.jpg");
}
JavaScript
$("#mToggle").click(function(){
$('#mToggle').toggleClass('left');
});
This should give me a button that is initially a right arrow and will swap between left and right every time upon the click.
Edit: I should mention that the second method that I described only results in the default "Submit Query" text appearing for the No picture is displayed.
Thanks in advance.