Filter by Tags

Which “href” value should I use for JavaScript links, “#” or “javascript:void(0)”?

Votes

0

0 0

The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is better, in terms of functionality, page load speed, validation purposes, etc.?


function myJsFunc() {
alert("myJsFunc");
}




or


function myJsFunc() {
alert("myJsFunc");
}

here is html I am using


 <a href="javascript:void(0)" onclick="myJsFunc();">Run JavaScript Code</a>
Manish Rawat
Posted on : Tue, Dec 26, 2017
Views : 64
Comments

Ask Question

If you want to ask question you must LogIn or SignUp
Login SignUp
To Add your Answer Please
LogIn | SignUp

Quick Links

E-Magazines

@

Total Followers
Study Group Created
Study Group Joined
Following Teacher
Following Organization
Blog Articles Added
Questions Asked
Questions Answered
Jobs Posted
Total Members in Group
Questions asked by members
Tasks added in this Group

Please wait..

Ok

Login to Open ESchool OR Create your account    Login   SignUp