We Recommend

HTML: The Definitive Guide HTML: The Definitive Guide
They teach you that learning HTML is like learning any other language and that reading a book of rules can only take you so far. Readers begin writing what may be their first Web page just two pages into the book's second chapter. From there on, they provide a wide range of HTML coding to allow readers to learn from good examples. The book includes a handy "cheat sheet" of HTML codes for quick reference.


Posted By

Feb30th1712 on 01/24/08


Tagged

css javascript event html style


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

skywalker


attach style and script to an ID


Published in: HTML 


Get style and scripts (onclick, onmouseover, etc) out of tags.


  1. #google {color: white; background: black}
  2. </style>
  3. </head>
  4. <a id="google" href="http://google.com/">google.com</a>
  5. <script type="text/javascript">
  6. document.getElementById("google").onclick = function() { return false; };
  7. </script>
  8. </html>

Report this snippet 

You need to login to post a comment.