javascript:void(0)

1 min read
Date: 2022-07-25
This tutorial explains the use of javascript:void(0)
in HTML. This JavaScript expression prevents page refreshes or redirects when a hyperlink is clicked. The void
operator evaluates an expression and returns undefined
, effectively making the link do nothing. A simple HTML example demonstrates this functionality. The tutorial guides users through creating an HTML file with a link using javascript:void(0)
, showing how the link remains inactive upon clicking.
Read more: https://examples.javacodegeeks.com/javascriptvoid0/
0
Subscribe to my newsletter
Read articles from Yatin B. directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
