/    Sign up×
Community /Pin to ProfileBookmark

Is that true the standard HTML tag allows a customerized attribute?

For instance:

<input id=”test” description=”abc”…

Actually, I saw the codes in working.

var desc = document.getElementById(“test”).getAttribute(‘description’);

And it is working in a live application. But I just want to confirm if a standard HTML tag allows a customerized attribute in it?

Thanks

Scott

Obviously the description is NOT an attribute for <input tag.

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@dtm32236Feb 13.2008 — people "make up" attributes all the time - i see this in many of the sites i review here...

it doesn't mean that it "works" or does anything... but i'm sure that .getAttribue('some_made_up_thing'); may work, just as using id or name would.

but, <input id="test" [B]description="abc"[/B]> isn't going to do anything different, I wouldn't think

just another example of worthless and invalid code... people may disagree though...
×

Success!

Help @scottjsn spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...