I need to use href instead click event so I can use hover in the following statement.
What I am trying to do is to be able to use href as if was click event, so I can attach a function through href, therefore I could use the hover efect which is alredy done on css.
Its a delete button, so it would be a grey x and if you hover goes red, and if you press the button then it would delete the row.
Thanks.
$(document).ready(function(){
$(".btnDeleteOther").live("click", function(){
$(this).closest('tr').not(':only-child').remove();
});
Any Ideas?
Thanks.
In some browsers a:hover does not work if you do not have an href to get the onclick and the hover functionality you can
the return false on the onclick will prevent the browsers default action taking place and the href=”#” means that even if it does this is just a link to this page.
As per the other answers you can then us the CSS hover pseudo-class to style the element
For the href=”#” I would put this in the html you submitted if not you can use the following jquery to add the attribute
As for returning false from the click event it appares that at least when you have only one click event defined jQuery will return what your click function returns so
Or use the preventDefault method on event
see http://api.jquery.com/click/