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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -