It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming JavaScript Forum

chained onclick events

chained onclick events

Postby qualaro on Sun Oct 11, 2009 6:30 pm

On the following code:

<p align="center"><a href="javascript: return void(0);" onClick="javascript:
document.getElementById('loc0_title').innerHTML = 'title1';
document.getElementById('loc0').innerHTML = '<a href=test.jpg class=highslide ><br><img src=test.jpg width=250 height=188 alt=Highslide title=Click /></a>'
"
<b>Test</b></a></p>


Is there any chance on the second "<a href" to put an onClick event ( ex. onClick="return hs.expand(this, {wrapperClassName: &#39;borderless floating-caption&#39;, dimmingOpacity: 0.75, align: &#39;center&#39;})" )?
qualaro
 
Posts: 1
Joined: Sun Oct 11, 2009 6:26 pm

Re: chained onclick events

Postby gun5 on Tue Nov 10, 2009 7:35 pm

Yes there is, you could call a function for that

Code: Select all
<script type="text/javascript">
function foo(me){
return alert(me.title);
}
</script>

<p align="center"><a href="javascript:void(0);" onClick="javascript:
document.getElementById('loc0_title').innerHTML = 'title1';
document.getElementById('loc0').innerHTML = '<a title=\'This is anchor\' onclick=\'return foo(this);\'><br><img src=\'test.jpg\'/></a>'
"
<b>Test</b></a></p>


Sortable List Game Trainer Game Cheats
gun5
 
Posts: 3
Joined: Tue Nov 10, 2009 6:11 pm


Return to JavaScript Forum

Who is online

Users browsing this forum: No registered users and 10 guests