Make a link unclickable with jQuery

If you need to make a html link unclickable a quick solution is to use the below jQuery

//make selected link unclickable
$('a.no_click').attr( 'onClick', 'return false' );

Might not be pretty but it works fine

Justin Kelly

Justin Kelly

Web Developer, Business Analytics, Data Engineer specialising in PHP and Tableau

Based in Melbourne, Australia

Feel free to contact me justin@kelly.org.au or _justin_kelly

Leave a comment

Name Notify me of replies by email.