Grow your CSS skills. Land your dream job.

Last updated on:

Comments in JavaScript

function doSomething() {

           This code by Chris Coyier

    var i = 0;    // counter to be used later;


Comments in JavaScript can be between /* */ markings (useful for multiple line comments) or after // markings (for single lines only).


  1. dev
    Permalink to comment#

    nice articles

  2. Doug Dennison
    Permalink to comment#

    I want to temporarily disable one of two email addresses in a javascript field, e.g.:

    <option value=",">Email Address</option>

    Any way to comment out one or the other?


Leave a Comment

Posting Code

  • Use Markdown, and it will escape the code for you, like `<div class="cool">`.
  • Use triple-backticks for blocks of code.
      <h1>multi-line block of code</h1>
      <span>be cool yo.</span>
  • Otherwise, escape your code, like <code>&lt;div class="cool"&gt;</code>. Markdown is just easier though.

Current ye@r *

*May or may not contain any actual "CSS" or "Tricks".