if this image is clicked:
<img src="images/del.png" width="15" height="15" onclick="hide(<?php echo $y;?>)">
this image should appear:
<img src="images/undo.png" width="20" height="20" onclick="show(<?php echo $y;?>)" title="undo">
2nd image won't replace the first one, it will appear somewhere else
check if the image is clicked
Moderator: General Moderators
Re: check if the image is clicked
this seems to be manageable via JavaScript not php.
Ill give you an example...The bases behind the code is that your updating the div with information and in this case updating it with a button.
<script>
function hide() { document.getElementById(div1).innerHTML = '<img src="images/undo.png" width="20" height="20" onclick="show()" title="undo">'; }
function show() { document.getElementById(div1).innerHTML = '<img src="images/del.png" width="15" height="15" onclick="hide()">'; }
</script>
<html>
<div id="div1"><img src="images/del.png" width="15" height="15" onclick="hide()"></div>
</html>
Ill give you an example...The bases behind the code is that your updating the div with information and in this case updating it with a button.
<script>
function hide() { document.getElementById(div1).innerHTML = '<img src="images/undo.png" width="20" height="20" onclick="show()" title="undo">'; }
function show() { document.getElementById(div1).innerHTML = '<img src="images/del.png" width="15" height="15" onclick="hide()">'; }
</script>
<html>
<div id="div1"><img src="images/del.png" width="15" height="15" onclick="hide()"></div>
</html>
Re: check if the image is clicked
thank you for your reply. i'd test this right away