I have page with several links and linked buttons. I want to disable all. How can I do this?
<div id="content-main">
<h1>My Notes</h1>
<a href="edit.html" id="btnNew" name="btnNew" class="button">Add new Link</a>
<table border="0" cellspacing="0" cellpadding="4">
<tr bgcolor="#edf3fe">
<td><a href="edit.html">Link 1</a></td>
<td><a href="edit.html">Link 2</a></td>
</tr>
</table>
<div class="button-row"></div>
</div>
I tried the following which is working to the point that link no longer works but I would like to fade the links too.
$(document).ready(function(){
$( "a" ).click(function( event ) {
alert( "The link will no longer work" );
event.preventDefault();
});
}); }
If you want them greyed out, then try this. Based on answer above:
BTW, word of advice for the newbie, it is always a good practice that I do, by making anything that is an jQuery object variable prefixed with '$'. Easy when you start doing multi-level context functions.