/    Sign up×
Community /Pin to ProfileBookmark

dynamic menu, value but no text

I am creating a dynamic menu for years (2005->…), which works fine in FF but in IE the value is created and is selectable, but text is blank. I have encountered this problem 3 times, but I was not able to find any other posts on the subject and I still don’t have a solution, so perhaps I am going about it all wrong. Is there another way to insert text into an option element other than what I’ve done below? Has encountered this problem? PLEASE HELP!

Here is my code:

[CODE]
var yr = new Date();
yr = yr.getFullYear();
for (var i = 2005; i <= yr; i++) {
var opt = document.createElement(“option”);
opt.setAttribute(“value”, i);
opt.text = i;
menu.appendChild(opt);
}[/CODE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@bwalker_lt___gt_authorMay 05.2006 — bump suggestions
×

Success!

Help @bwalker_lt___gt_ 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.15,
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,
)...