I recently got this simple script to show/hide several sections of an html page. I'm using it to show/hide the content of a div by clicking small "+" and "-":
function toggle1() {
var ele = document.getElementById("toggleText1");
var text = document.getElementById("displayText1");
if(ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "+";
}
else {
ele.style.display = "block";
text.innerHTML = "-";
}
}
Along with:
<a href="javascript:toggle1();" class="txt_side_table_cmd" id="displayText1><img src="imgs/up.gif" /></a>
<div id="toggleText1" style="display: block">Content here</div>
The code works fine but i'm trying to change the "+" and "-" text links to images links. I have very little knowlege of Javascript and I tried various modifications that made it worst. This original script in in an extrenal .js file.
Any ideas as how to change text links to image links ?
Thank you very much