Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="application/xhtml+xml;charset=utf-8" />
- <title>Not document.write()</title>
- <style type="text/css">
- .message {margin: 0.5em; padding: 0.5em; border: 3px solid #333; color: #000;}
- .message strong {color: #c00;}
- </style>
- <script type="text/javascript">
- <![CDATA[
- window.addEventListener(
- 'load',
- function(){
- var clicked = 0;
- document.addEventListener(
- 'click',
- function(){
- document.body.innerHTML =
- '<div class="message">This has been clicked <strong>'+ (++clicked) +'</strong> times.</div>'
- + document.body.innerHTML;
- },
- false
- );
- },
- false
- );
- ]]>
- </script>
- </head>
- <body>
- <div class="message">This has been clicked <strong>0</strong> times.</div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement