/    Sign up×
Community /Pin to ProfileBookmark

Dynamic content Firefox innerHTML problem

I am encountering this problem with Firefox, but no problem in IE.

I have in a hidden <div> dynamically generated select options intended for re-use by dynamically created forms on page.

For Example:

<div>
<option value=”1″>xxx</option>


</div>

With javascript, when I use getElementById() to get the <div>, and then get the innerHTML, on IE I get the content just as they were generated out, and I was able to put this into an empty <select> and everything works. But when I try the same in Firefox, the innerHTML returns only the text part of the content. The “<option value=”1″>” part has been stripped off. Wondering if there’s a solution to get around this?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@FangSep 29.2010 — Invalid markup. Hold the <option>s in a <select> or a JavaScript array.
×

Success!

Help @DioSeijuro 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.23,
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,
)...