Reputation: 1831
<a href="javascript:void(0);" class="selectedpagination" onclick="changeuploader();">
Try flash Uploader
</a>
If I write in anchor tag's first parameter javascript:void(0);
, it will open link to controller/javascript:void(0)
Also, how do I give it the class name and onclick event?
Upvotes: 2
Views: 5173
Reputation:
Easy as that:
anchor('#', 'Try flash Uploader', array('class'=>'selectedpagination', 'onclick'=>'changeuploader();'));
Check this https://www.codeigniter.com/user_guide/helpers/url_helper.html
Upvotes: 8
Reputation: 79
I didn't find another solution instead of: $("a").removeAttr("href");
Upvotes: 0
Reputation: 4075
onclick="return false();"
$('.selectedpagination').click(function(){ //To click here });You can use button.
Upvotes: 0
Reputation: 1317
Try this
<a href="javascript:void(0);" class="selectedpagination" onclick="javascript:changeuploader();">
Try flash Uploader
</a>
Upvotes: -1
Reputation: 58444
Please stop doing <a href="javascript:void(0);" ... >
. It is an extremely bad practice. And so is attaching events in HTML.
Instead you should attach events in an external JS file. PHP framework has nothing to do with this.
Upvotes: 1