website - Change <href> to <script> javascript? -
how make href thing script executed when enter webpage?
<a href="javascript:void();" onclick="document.getelementbyid('underlay').style.display='block';document.getelementbyid('lightbox').style.display='block';">click here</a> <div id="underlay"> </div> <div id="lightbox"> <a href="javascript:void();" onclick="document.getelementbyid('underlay').style.display='none'; document.getelementbyid('lightbox').style.display='none';">close</a> </div>
place <script>
tag @ end of body.
you can place in head, although has wait until page loads:
<script> window.addeventlistener('load', function () { document.getelementbyid('underlay').style.display='block'; document.getelementbyid('lightbox').style.display='block'; }, false); </script>
Comments
Post a Comment