Usage demonstration of round function in JavaScript

From , 5 Years ago, written in JavaScript, viewed 73 times.
URL https://pastebin.vip/view/4fa04fbc
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <p id="demo">Click the button to round the number 2.5 to its nearest integer.</p>
  6.  
  7. <button onclick="myFunction()">Try it</button>
  8.  
  9. <script>
  10. function myFunction()
  11. {
  12. document.getElementById("demo").innerHTML=Math.round(2.5);
  13. }
  14. </script>
  15.  
  16. </body>
  17. </html>
  18.  
  19. //javascript/7873

Reply to "Usage demonstration of round function in JavaScript"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website