What is href=[removed];

前端 未结 8 909
天命终不由人
天命终不由人 2020-12-31 18:42

in a code which i am goin through there is a link has href=javascript:; in code.when it is clicked it opens a lightbox to show some msg with close button.how is it done.I th

8条回答
  •  伪装坚强ぢ
    2020-12-31 19:28

    href="javascript:somefunction();" is just a way to point to a function of some javascript code.

    You can also do: href="#" onclick="somefunction();return false;"

    Nothing really dojo about it. All it does is call the function or javascript code. It just tells the element to use javascript.

    or href="javascript:void(0);" onclick="somefunction();" as stated already.

提交回复
热议问题