Reloading a div with javascript without reloading the whole page - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:on

Description

Reloading a div with javascript without reloading the whole page

Demo Code

ResultView the demo in separate window

<html>
   <head>
      <script src="https://code.jquery.com/jquery-latest.js"></script> 
      <script>
        $(document).ready(function() {
            $('#btn_click').on('click', function () {
                $('#publish').html($('#publish').html() + 1);
            });/*  ww  w .j  a va 2 s  .c o  m*/
        });
    
      </script> 
   </head>
   <body> 
      <div id="publish">
         5
      </div> 
      <button type="button" id="btn_click">clickme</button>  
   </body>
</html>

Related Tutorials