Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Javascript is <strong>ALWAYS</strong> case-sensitive, html is not.</p> <p>It sounds as thought you are talking about whether html attributes (e.g. onclick) are or are not case-sensitive. The answer is that the attributes are not case sensitive, but the way that we access them through the DOM is. So, you can do this:</p> <pre><code>&lt;div id='divYo' onClick="alert('yo!');"&gt;Say Yo&lt;/div&gt; // Upper-case 'C' </code></pre> <p>or:</p> <pre><code>&lt;div id='divYo' onclick="alert('yo!');"&gt;Say Yo&lt;/div&gt; // Lower-case 'C' </code></pre> <p>but through the DOM you must use the correct case. So this works:</p> <pre><code>getElementById('divYo').onclick = function() { alert('yo!'); }; // Lower-case 'C' </code></pre> <p>but you cannot do this:</p> <pre><code>getElementById('divYo').onClick = function() { alert('yo!'); }; // Upper-case 'C' </code></pre> <p>EDIT: CMS makes a great point that most DOM methods and properties are in <a href="http://www.perlmonks.org/?node_id=45213" rel="nofollow noreferrer">camelCase</a>. The one exception that comes to mind are event handler properties and these are generally accepted to be <a href="http://javascript.about.com/library/blonclick.htm" rel="nofollow noreferrer">the wrong way to attach to events</a> anyway. Prefer using <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener" rel="nofollow noreferrer"><code>addEventListener</code></a> as in:</p> <pre><code>document.getElementById('divYo').addEventListener('click', modifyText, false); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload