Reputation: 88
I'm new to Android/iOS applications. I made an app using PhoneGap, and I built it. Anyway, the links that are written like this are not working:
<a href="javascript:functionName();">click me</a>
What is the best way to fix it?
Upvotes: 0
Views: 796
Reputation: 1068
You can try this way:
<a id="anchorID">click me</a>
$("#anchorID").on("click", function() {
// your JS code
});
Upvotes: 2
Reputation: 109
You can try something like this:
<a onClick="functionName();" href="javascript:void(0)">click me</a>
Upvotes: 3