How do I make the click not move an element in jQuery?

Asked

Viewed 36 times

0

In this example depending on the place I click, the page moves to reach the ID that is being selected with the click. I would like to prevent the page NAY moved independently of the given click.

I used this code because I need to get the ID of that element HTML A ...

$("#map li a").click(function(){

    var estado = $(this).attr("id");
    var Cestado = estado.toUpperCase();
    alert(Cestado); 

});
  • 3

    Mark, I marked it as duplicate because I think you need to use event.preventDefault()

  • 1

    Mark what you need is http://jsfiddle.net/aumb6zd7/ but if I’m wrong about the duplicate say it because I don’t want to stop you from finding a solution to the problem...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.