Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
116
rated 0 times [  122] [ 6]  / answers: 1 / hits: 40397  / 12 Years ago, tue, october 23, 2012, 12:00:00

Possible Duplicate:

What does “javascript:void(0)” mean?






I want to ask a few questions regarding javascript:void(0)



<input type='submit' name='btn' value='submit' onClick='javascript:void(0)' />


Can you please explain void(0) - is it a built-in function? Does the keyword javascript represent that the code is written in javascript? If there is anything weird that you know about it, please share it with me. Thank you.


More From » javascript

 Answers
76

void():




This operator allows inserting expressions that produce side effects
into places where an expression that evaluates to undefined is
desired.



The void operator is often used merely to obtain the undefined
primitive value
, usually using void(0) (which is equivalent to void
0). In these cases, the global variable undefined can be used instead
(assuming it has not been assigned to a non-default value).
Note, however, that the javascript: pseudo protocol is discouraged over other alternatives, such as unobtrusive event handlers.




You can read more on this similar thread: What does "javascript:void(0)" mean?


[#82390] Monday, October 22, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
janettejordynm

Total Points: 550
Total Questions: 94
Total Answers: 98

Location: Senegal
Member since Fri, Aug 21, 2020
4 Years ago
janettejordynm questions
Tue, Nov 24, 20, 00:00, 4 Years ago
Sat, May 23, 20, 00:00, 4 Years ago
Mon, Apr 6, 20, 00:00, 4 Years ago
Tue, Feb 18, 20, 00:00, 4 Years ago
;