sapo
Power Member
- Feb 25, 2008
- 510
- 286
okay so I have a locker that get triggered through an ID. Works fine in regular HTML but once I place the trigger link in innerHTML it will not trigger my locker.
that normal code that triggers the locker is (id that trigger is "pop")
and this is the code I use on innerHTML, but it does not trigger the locker
Now this doesnt work, I know its something to do how innerHTML handles this or something, Ive been reading alot and trying alot of things Like, trying to trigger the fucntion() , trying onclick, a bunch but its out of my element to figure out at this time. I hate asking question but when you need help you need help.
I have set up a live site so you can see the code and everything in its entirety so you can properly evaluate it.
Thanks any help is appreciated.
that normal code that triggers the locker is (id that trigger is "pop")
Code:
<a id="pop" href="javascript:void()">How the Locker POPS Normally</a>
and this is the code I use on innerHTML, but it does not trigger the locker
Code:
<script type="text/javascript">
function ChangeStyle()
{
document.getElementById("p12").innerHTML = "<div class=\"button\"><a id=\"pop\" href=\"javascript:void()\">Second Button - innerHTML (this Should trigger the Locker)</a></div>";
}
</script>
<span id="p12">
<div class="button"><a href="javascript:void()" onclick="ChangeStyle();">First Button (this should trigger innerHTML) </a></div></span>
Now this doesnt work, I know its something to do how innerHTML handles this or something, Ive been reading alot and trying alot of things Like, trying to trigger the fucntion() , trying onclick, a bunch but its out of my element to figure out at this time. I hate asking question but when you need help you need help.
I have set up a live site so you can see the code and everything in its entirety so you can properly evaluate it.
Code:
http://bit.ly/PWRNZG
Thanks any help is appreciated.
Last edited: