---
title: "Meaning & Key Takeaway of: Remember what happens when you call…"
description: "\"“Remember what happens when you call getElementById and the id doesn’t exist in the DOM? You get null. Same thing with getAttribute. If”\" — Eric Freeman"
image: "https://sms4smile.com/quotes/i/45c/eric-freeman-7573_quote_remember-what-happens-when-you-call-gete_2180336.jpg"
---

#  Remember what happens when you call getElementById and the…

![“Remember what happens when you call getElementById and the id doesn’t exist in the DOM? You get null. Same thing with getAttribute. If” quote by Eric Freeman](https://sms4smile.com/quotes/i/45c/eric-freeman-7573_quote_remember-what-happens-when-you-call-gete_2180336.jpg)   [Download](https://sms4smile.com/quotes/i/45c/eric-freeman-7573_quote_remember-what-happens-when-you-call-gete_2180336.jpg) [Open image](https://sms4smile.com/quotes/i/45c/eric-freeman-7573_quote_remember-what-happens-when-you-call-gete_2180336.jpg)

> ““Remember what happens when you call getElementById and the id doesn’t exist in the DOM? You get null. Same thing with getAttribute. If””

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

## About This Quote

This interpretation was drafted with AI assistance. It is one reading of the quote, not the author's own explanation.

The quote uses a programming analogy to illustrate that missing elements return null, emphasizing the importance of handling absent data.

**In simple terms:** Missing IDs return null; handle it.

Key Takeaway

Always check for null values.

Themes

programming software development error handling validation robustness

Mood

practical technical

Type

instructional technical

When to use this quote

- web development
- API integration
- debugging sessions
- code reviews
- teaching programming

Key Concepts

null reference DOM manipulation defensive coding

Questions to Reflect On

- What safeguards do you use for missing data?
- How can you design APIs to avoid null?

A Different Perspective

Overreliance on null checks can hide deeper logic errors.

★ ★ ★ ★ ★   No ratings yet

[Technology](https://sms4smile.com/quotes/about/technology/)

## Related quotes

> [“Remember, null is intended to represent an object that isn’t there.”](https://sms4smile.com/quotes/eric-freeman/remember-null-is-intended-to-represent-an-object-that-isn-t-there/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [Professor von Mises has a splendid analytical mind and an admirable passion for liberty; but as a student of human nature he is worse…](https://sms4smile.com/quotes/ludwig-von-mises/professor-von-mises-has-a-splendid-analytical-mind-and-an-admirable/)

[Ludwig von Mises](https://sms4smile.com/quotes/author/ludwig-von-mises/)

> [Every discrimination against women in the constitutions and laws of the several States is today null and void, precisely as in every one against…](https://sms4smile.com/quotes/susan-b-anthony/every-discrimination-against-women-in-the-constitutions-and-laws-of/)

[Susan B. Anthony](https://sms4smile.com/quotes/author/susan-b-anthony/)

> [God's word will NEVER come back null and void.](https://sms4smile.com/quotes/anonymous/god-s-word-will-never-come-back-null-and-void/)

[Anonymous](https://sms4smile.com/quotes/author/anonymous/)

> [In masturbation there is nothing but loss. There is no reciprocity. There is merely the spending away of a certain force, and no return.…](https://sms4smile.com/quotes/anonymous/in-masturbation-there-is-nothing-but-loss-there-is-no-reciprocity/)

[Anonymous](https://sms4smile.com/quotes/author/anonymous/)

> [Not so much anymore but some years ago in my homeland there was a habit, something called 'casamiento de apuro,' a marriage in haste…](https://sms4smile.com/quotes/pope-francis/not-so-much-anymore-but-some-years-ago-in-my-homeland-there-was-a/)

[Pope Francis](https://sms4smile.com/quotes/author/pope-francis/)

> [When human laws contradict or discountenance the means, which are necessary to preserve the essential rights of any society, they defeat the proper end…](https://sms4smile.com/quotes/alexander-hamilton/when-human-laws-contradict-or-discountenance-the-means-which-are/)

[Alexander Hamilton](https://sms4smile.com/quotes/author/alexander-hamilton/)

> [Anarchism is the only philosophy which brings to man the consciousness of himself; which maintains that God, the State, and society are non-existent, that…](https://sms4smile.com/quotes/emma-goldman/anarchism-is-the-only-philosophy-which-brings-to-man-the/)

[Emma Goldman](https://sms4smile.com/quotes/author/emma-goldman/)

> [Throughout the 1960s and 1970s devoted Beckett readers greeted each successively shorter volume from the master with a mixture of awe and apprehensiveness; it…](https://sms4smile.com/quotes/john-banville/throughout-the-1960s-and-1970s-devoted-beckett-readers-greeted-each/)

[John Banville](https://sms4smile.com/quotes/author/john-banville/)

> [Every law of matter or the body, supposed to govern man,is rendered null and void by the law of Life, God.](https://sms4smile.com/quotes/mary-baker-eddy/every-law-of-matter-or-the-body-supposed-to-govern-man-is-rendered/)

[Mary Baker Eddy](https://sms4smile.com/quotes/author/mary-baker-eddy/)

> [There shall never be one lost good! What was, shall live as before; The evil is null, is nought, is silence implying sound; What…](https://sms4smile.com/quotes/robert-browning/there-shall-never-be-one-lost-good-what-was-shall-live-as-before-the/)

[Robert Browning](https://sms4smile.com/quotes/author/robert-browning/)

> [Due to the oath I swore to the constitution when I enlisted in the United States Marine Corps, by virtue of the universal human…](https://sms4smile.com/quotes/adam-kokesh/due-to-the-oath-i-swore-to-the-constitution-when-i-enlisted-in-the/)

Adam Kokesh

> [And don't tell me there isn't one bit of difference between null and space, because that's exactly how much difference there is.](https://sms4smile.com/quotes/larry-wall/and-don-t-tell-me-there-isn-t-one-bit-of-difference-between-null-and/)

[Larry Wall](https://sms4smile.com/quotes/author/larry-wall/)

> [Mathematics can remove no prejudices and soften no obduracy. It has no influence in sweetening the bitter strife of parties, and in the moral…](https://sms4smile.com/quotes/johann-wolfgang-von-goethe/mathematics-can-remove-no-prejudices-and-soften-no-obduracy-it-has-no/)

[Johann Wolfgang von Goethe](https://sms4smile.com/quotes/author/johann-wolfgang-von-goethe/)

> [All religious vows, codes, and commitments are null &amp; void herein. Please refrain from contaminating the ideosphere with harmful memes through prayer, reverence, holy…](https://sms4smile.com/quotes/greg-erwin/all-religious-vows-codes-and-commitments-are-null-void-herein-please/)

Greg Erwin

## More by Eric Freeman

> [“When you delete a property, you’re not just deleting the value of the property, you’re deleting the property itself. And, if you try to…](https://sms4smile.com/quotes/eric-freeman/when-you-delete-a-property-you-re-not-just-deleting-the-value-of-the/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“the constructor always has a prototype property. More”](https://sms4smile.com/quotes/eric-freeman/the-constructor-always-has-a-prototype-property-more/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“when you assign a value to a variable name that hasn’t been previously declared, it is treated as a new, global variable. So be…](https://sms4smile.com/quotes/eric-freeman/when-you-assign-a-value-to-a-variable-name-that-hasn-t-been/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Web Workers have a global function named importScripts that you can use to import one or more JavaScript files into your worker. To”](https://sms4smile.com/quotes/eric-freeman/web-workers-have-a-global-function-named-importscripts-that-you-can/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“If the two values have different types, try to convert them into the same type and then compare them”](https://sms4smile.com/quotes/eric-freeman/if-the-two-values-have-different-types-try-to-convert-them-into-the/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Well, it’s a browser policy, and it says you can’t retrieve data from a domain that is different from the domain the page itself…](https://sms4smile.com/quotes/eric-freeman/well-it-s-a-browser-policy-and-it-says-you-can-t-retrieve-data-from-a/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Math is not a constructor, or even a function. It’s an object. As you know, Math is a built-in object that you can use…](https://sms4smile.com/quotes/eric-freeman/math-is-not-a-constructor-or-even-a-function-it-s-an-object-as-you/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“When you pass zero to setTimeout, you’re asking JavaScript to run your timeout handler as soon as it possibly can — and this leads…](https://sms4smile.com/quotes/eric-freeman/when-you-pass-zero-to-settimeout-you-re-asking-javascript-to-run-your/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“JavaScript doesn’t have a character type. So characters are returned as new strings containing one character.”](https://sms4smile.com/quotes/eric-freeman/javascript-doesn-t-have-a-character-type-so-characters-are-returned/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Closures are often used to capture state for event handlers.”](https://sms4smile.com/quotes/eric-freeman/closures-are-often-used-to-capture-state-for-event-handlers/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Lexical scope means that we can determine the scope of a variable by reading our code.”](https://sms4smile.com/quotes/eric-freeman/lexical-scope-means-that-we-can-determine-the-scope-of-a-variable-by/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Q: Q: You said getElementsByTagName returns a list. Do you mean an array? A: A: It returns an object that you can treat like…](https://sms4smile.com/quotes/eric-freeman/q-q-you-said-getelementsbytagname-returns-a-list-do-you-mean-an-array/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“the truth is JavaScript actually makes two passes over your page: in the first pass it reads all the function definitions, and in the…](https://sms4smile.com/quotes/eric-freeman/the-truth-is-javascript-actually-makes-two-passes-over-your-page-in/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“If you change any property in the prototype, it affects all the objects that inherit from that prototype, unless that object has overridden that…](https://sms4smile.com/quotes/eric-freeman/if-you-change-any-property-in-the-prototype-it-affects-all-the/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“methods in objects are properties too. They just happen to have a function assigned to them.”](https://sms4smile.com/quotes/eric-freeman/methods-in-objects-are-properties-too-they-just-happen-to-have-a/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

[Explore all 90 Eric Freeman quotes ](https://sms4smile.com/quotes/author/eric-freeman/)

## More Null quotes

> [All religious vows, codes, and commitments are null &amp; void herein. Please refrain from contaminating the ideosphere with harmful memes through prayer, reverence, holy…](https://sms4smile.com/quotes/greg-erwin/all-religious-vows-codes-and-commitments-are-null-void-herein-please/)

Greg Erwin

> [Mathematics can remove no prejudices and soften no obduracy. It has no influence in sweetening the bitter strife of parties, and in the moral…](https://sms4smile.com/quotes/johann-wolfgang-von-goethe/mathematics-can-remove-no-prejudices-and-soften-no-obduracy-it-has-no/)

[Johann Wolfgang von Goethe](https://sms4smile.com/quotes/author/johann-wolfgang-von-goethe/)

> [And don't tell me there isn't one bit of difference between null and space, because that's exactly how much difference there is.](https://sms4smile.com/quotes/larry-wall/and-don-t-tell-me-there-isn-t-one-bit-of-difference-between-null-and/)

[Larry Wall](https://sms4smile.com/quotes/author/larry-wall/)

> [Due to the oath I swore to the constitution when I enlisted in the United States Marine Corps, by virtue of the universal human…](https://sms4smile.com/quotes/adam-kokesh/due-to-the-oath-i-swore-to-the-constitution-when-i-enlisted-in-the/)

Adam Kokesh

> [There shall never be one lost good! What was, shall live as before; The evil is null, is nought, is silence implying sound; What…](https://sms4smile.com/quotes/robert-browning/there-shall-never-be-one-lost-good-what-was-shall-live-as-before-the/)

[Robert Browning](https://sms4smile.com/quotes/author/robert-browning/)

> [Every law of matter or the body, supposed to govern man,is rendered null and void by the law of Life, God.](https://sms4smile.com/quotes/mary-baker-eddy/every-law-of-matter-or-the-body-supposed-to-govern-man-is-rendered/)

[Mary Baker Eddy](https://sms4smile.com/quotes/author/mary-baker-eddy/)

> [Throughout the 1960s and 1970s devoted Beckett readers greeted each successively shorter volume from the master with a mixture of awe and apprehensiveness; it…](https://sms4smile.com/quotes/john-banville/throughout-the-1960s-and-1970s-devoted-beckett-readers-greeted-each/)

[John Banville](https://sms4smile.com/quotes/author/john-banville/)

> [Anarchism is the only philosophy which brings to man the consciousness of himself; which maintains that God, the State, and society are non-existent, that…](https://sms4smile.com/quotes/emma-goldman/anarchism-is-the-only-philosophy-which-brings-to-man-the/)

[Emma Goldman](https://sms4smile.com/quotes/author/emma-goldman/)

> [When human laws contradict or discountenance the means, which are necessary to preserve the essential rights of any society, they defeat the proper end…](https://sms4smile.com/quotes/alexander-hamilton/when-human-laws-contradict-or-discountenance-the-means-which-are/)

[Alexander Hamilton](https://sms4smile.com/quotes/author/alexander-hamilton/)

> [Not so much anymore but some years ago in my homeland there was a habit, something called 'casamiento de apuro,' a marriage in haste…](https://sms4smile.com/quotes/pope-francis/not-so-much-anymore-but-some-years-ago-in-my-homeland-there-was-a/)

[Pope Francis](https://sms4smile.com/quotes/author/pope-francis/)

> [In masturbation there is nothing but loss. There is no reciprocity. There is merely the spending away of a certain force, and no return.…](https://sms4smile.com/quotes/anonymous/in-masturbation-there-is-nothing-but-loss-there-is-no-reciprocity/)

[Anonymous](https://sms4smile.com/quotes/author/anonymous/)

> [God's word will NEVER come back null and void.](https://sms4smile.com/quotes/anonymous/god-s-word-will-never-come-back-null-and-void/)

[Anonymous](https://sms4smile.com/quotes/author/anonymous/)

> [Every discrimination against women in the constitutions and laws of the several States is today null and void, precisely as in every one against…](https://sms4smile.com/quotes/susan-b-anthony/every-discrimination-against-women-in-the-constitutions-and-laws-of/)

[Susan B. Anthony](https://sms4smile.com/quotes/author/susan-b-anthony/)

> [Professor von Mises has a splendid analytical mind and an admirable passion for liberty; but as a student of human nature he is worse…](https://sms4smile.com/quotes/ludwig-von-mises/professor-von-mises-has-a-splendid-analytical-mind-and-an-admirable/)

[Ludwig von Mises](https://sms4smile.com/quotes/author/ludwig-von-mises/)

> [A strong person makes the law and custom null before his own will.](https://sms4smile.com/quotes/ralph-waldo-emerson/a-strong-person-makes-the-law-and-custom-null-before-his-own-will/)

[Ralph Waldo Emerson](https://sms4smile.com/quotes/author/ralph-waldo-emerson/)

Browse all 41 Null quotes

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "Quotation",
            "text": "“Remember what happens when you call getElementById and the id doesn’t exist in the DOM? You get null. Same thing with getAttribute. If”",
            "creator": {
                "@type": "Person",
                "name": "Eric Freeman"
            },
            "isPartOf": {
                "@id": "https://sms4smile.com/quotes/#website"
            },
            "url": "https://sms4smile.com/quotes/eric-freeman/remember-what-happens-when-you-call-getelementbyid-and-the-id-doesn-t/",
            "about": {
                "@type": "Thing",
                "name": "Null"
            },
            "@id": "https://sms4smile.com/quotes/eric-freeman/remember-what-happens-when-you-call-getelementbyid-and-the-id-doesn-t/#quotation",
            "image": {
                "@type": "ImageObject",
                "@id": "https://sms4smile.com/quotes/i/45c/eric-freeman-7573_quote_remember-what-happens-when-you-call-gete_2180336.jpg",
                "contentUrl": "https://sms4smile.com/quotes/i/45c/eric-freeman-7573_quote_remember-what-happens-when-you-call-gete_2180336.jpg",
                "url": "https://sms4smile.com/quotes/i/45c/eric-freeman-7573_quote_remember-what-happens-when-you-call-gete_2180336.jpg",
                "width": 1080,
                "height": 1080,
                "caption": "“Remember what happens when you call getElementById and the id doesn’t exist in the DOM? You get null. Same…” — Eric Freeman",
                "creditText": "SMS4Smile Quotes",
                "creator": {
                    "@id": "https://sms4smile.com/quotes/#organization"
                }
            }
        },
        {
            "@type": "BreadcrumbList",
            "itemListElement": [
                {
                    "@type": "ListItem",
                    "position": 1,
                    "name": "Home",
                    "item": "https://sms4smile.com/"
                },
                {
                    "@type": "ListItem",
                    "position": 2,
                    "name": "Quotes",
                    "item": "https://sms4smile.com/quotes/"
                },
                {
                    "@type": "ListItem",
                    "position": 3,
                    "name": "Eric Freeman",
                    "item": "https://sms4smile.com/quotes/author/eric-freeman/"
                },
                {
                    "@type": "ListItem",
                    "position": 4,
                    "name": "“Remember what happens when you call...",
                    "item": "https://sms4smile.com/quotes/eric-freeman/remember-what-happens-when-you-call-getelementbyid-and-the-id-doesn-t/"
                }
            ],
            "@id": "https://sms4smile.com/quotes/eric-freeman/remember-what-happens-when-you-call-getelementbyid-and-the-id-doesn-t/#breadcrumb"
        },
        {
            "@type": "WebSite",
            "@id": "https://sms4smile.com/quotes/#website",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "publisher": {
                "@id": "https://sms4smile.com/quotes/#organization"
            }
        },
        {
            "@type": "Organization",
            "@id": "https://sms4smile.com/quotes/#organization",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "logo": {
                "@type": "ImageObject",
                "url": "https://sms4smile.com/quotes/wp-content/themes/sq/assets/icons/icon-512.png",
                "width": 512,
                "height": 512
            }
        }
    ]
}
```
