how to prevent browser to jump on top ??
- <!DOCTYPE html>
- <html>
- <head>
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- </head>
- <body>
-
- <a href="http://jquery.com">default click action is prevented</a>
- <div id="log"></div>
- <script>
- $("a").click(function(event) {
- event.preventDefault();
- $('<div/>')
- .append('default ' + event.type + ' prevented')
- .appendTo('#log');
- });
- </script>
- </body>
- </html>
this program works very fine for links but if the condition is like this <input type="submit">
then what is the solution?? I mean what if i have submit button of form instead of link.
actually i want to use it in php files.