Javascript examples for jQuery Method and Property:html
Count a variable inside of innerHTML
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> <script type="text/javascript"> window.onload=function(){/*from w w w . ja v a 2s . c o m*/ var counter = 1; counter++; console.log(counter); $(".end").html('Test ' +( counter + 1 )+ ' Test'); } </script> </head> <body> <p class="end"></p> </body> </html>