About 13,700,000 results
Open links in new tab
  1. javascript - image returns value "null" - Stack Overflow

    Feb 4, 2013 · I have a javascript code that points to an image using getElementById. But when I debug it in firebug, it says that my variable has a value of "null". Here is my code: var image = …

  2. Check if an img src is Valid or Empty in JavaScript - bobbyhadz

    Use the getAttribute() method to check if an image src is empty. If the src attribute doesn't exist, the method returns either null or an empty string, depending on the browser's implementation. …

  3. null - JavaScript | MDN - MDN Web Docs

    Apr 27, 2025 · The null value represents the intentional absence of any object value. It is one of JavaScript's primitive values and is treated as falsy for boolean operations. The value null is …

  4. Null in JavaScript - GeeksforGeeks

    Jun 5, 2024 · In JavaScript, both undefined and null represent the absence of a meaningful value, but they have different purposes and are used in distinct contexts. Knowing when and how to …

  5. HTML DOM Image Object - W3Schools

    The Image object represents an HTML <img> element. You can access an <img> element by using getElementById (): Tip: You can also access an <img> element by using the images …

  6. javascript - Check if img src tag is empty or null or undefinded ...

    Feb 25, 2023 · const imgElement = document.querySelector('img'); const imgSrc = imgElement.getAttribute('src'); if (!imgSrc || imgSrc.trim() === '') { console.log('Image src is …

  7. An Essential Guide to JavaScript null - JavaScript Tutorial

    JavaScript null is a primitive type that contains a special value null. JavaScript uses the null value to represent the intentional absence of any object value. If you find a variable or a function that …

  8. JavaScript >> Objects >> Image - DevGuru

    For an image created using the Image constructor, the value of this property is null. lowsrc. Syntax: Image.lowsrc. The lowsrc property specifies the URL of a low-resolution version of an …

  9. Handling null and undefined in JavaScript | by Eric Elliott ...

    Nov 11, 2019 · In your own functions, you can avoid creating null or undefined values to begin with. There are a couple ways to do that built into JavaScript that spring to mind. See below. …

  10. JS Check for NullNull Checking in JavaScript Explained

    Nov 29, 2022 · Null is a primitive type in JavaScript. This means you are supposed to be able to check if a variable is null with the typeof() method. But unfortunately, this returns “object” …

  11. Some results have been removed
Refresh