K
KS
Just to show some code to show the consept.
<img id="date" onclick="javascript:show_calendar();"
src="/PlexSysWeb/images/show-calendar.gif" width=20 height=18 border=0>
What i want the javascript to do is change the onclick value of the <IMG>
tag above, by calling the test function from the same webpage by onclick on
a button.
<input type="button" onclick="test()"value="test"/>
<script language='JavaScript'>
function test(){
document.all.date.onclick = "alert('kalenderdato')";
}
</script>
The problem is when i first click the button, and then the <IMG> tag on the
same webpage, the script has not change it. I dont get the alert but the
original onclick value from the IMG.
KS
<img id="date" onclick="javascript:show_calendar();"
src="/PlexSysWeb/images/show-calendar.gif" width=20 height=18 border=0>
What i want the javascript to do is change the onclick value of the <IMG>
tag above, by calling the test function from the same webpage by onclick on
a button.
<input type="button" onclick="test()"value="test"/>
<script language='JavaScript'>
function test(){
document.all.date.onclick = "alert('kalenderdato')";
}
</script>
The problem is when i first click the button, and then the <IMG> tag on the
same webpage, the script has not change it. I dont get the alert but the
original onclick value from the IMG.
KS