Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7782813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:39:29+00:00 2026-06-01T19:39:29+00:00

If I put a made-up attribute on an element then element.madeUpAttribute should return false.

  • 0

If I put a made-up attribute on an element then element.madeUpAttribute should return false. (It does in modern browsers.)

However in IE8- it returns the attribute value, acting just like: element.getAttribute('madeUpAttribute').

Any way to make it return the attribute value only if the attribute is supported by the browser?

Thanks guys!

[update]

Here’s a demo: http://jsfiddle.net/Daniel_Hug/rWz2n/

This is what it looks like in IE8:

http://f.cl.ly/items/0d1t3l2E1n1a3j0l1W2j/IE8.png

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:39:30+00:00Added an answer on June 1, 2026 at 7:39 pm

    Checking, whether some feature is supported with 'madeUpAttribute' in element does the trick in several cases for me.

    Actaually you may try to check element’s prototype.

    There’s no prototype for DOM objects in older IE, but there’s one interesting ancient feature

    if (element.prototype) {
      return 'madeUpAttribute' in element.prototype
    } else {
      document.expando = false;
      var hasProp = true;
      try {
        element.madeUpAttribute = element.madeUpAttribute;
      } catch(e) {
        hasProp = false;
      }
      document.expando = true;
      return hasProp;
    }
    

    This will work for the first assignment, though. After property is set, it is considered, that it do exists.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JavaScript class that I have made and put it into its
I have a new app that I made and put in the store yesterday.
I made a class library, and put it in GAC. It has one C#
I have made a custom Attribute here named AAtribute, and for instance a class
Every time I put an inline tag on the link's href attribute it somehow
I made my own contentprovider where I put a lot of data in at
I made an app for parents to put on Their kids phones but need
Thanks in advance i have made one attribute with option of yes/no i want
Put differently: Is there a good reason to choose a loosely-typed collection over a
Put it another way: what code have you written that cannot fail. I'm interested

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.