You must have used the JS document.write() after rendering all the html Example on how it doesn't work: <!DOCTYPE html> <html> <body> <p>paragraph</p> <button type="button" onclick="document.write(5 + 6)">click to see</button> </body> </html>