/    Sign up×
Community /Pin to ProfileBookmark

Why it’s not working in FF

I have this script:

<a href=”javascript:showHide(details23)”>More…</a>

<div id=”details23″ style=”display: none;”>
Text Text Text Text Text Text Text Text Text Text Text
</div>

It’s working great on IE but not on FF. Why’s that?

Thanks!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangDec 21.2004 — Probably this: showHide([COLOR=green]'[/COLOR]details23[COLOR=green]'[/COLOR])
Copy linkTweet thisAlerts:
@CharlesDec 21.2004 — [font=monospace]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta name="Content-Script-Type" content="text/javascript">

<meta name="Content-Style-Type" content="text/css">

<title>Example</title>

<style type="text/css">

<!--

.hide {display:none}

-->

</style>

</head>

<body>

<script type="text/javascript">

<!--

// [i]Because one in ten users does not use JavaScript you need to hide the element with JavaScript. Otherwise it would never be seen by those good users.[/i]

onload = function () {document.getElementById ('details23').className = 'hide'}

// [i]Likewise, you don't want the link to be seen when it will not do anything. So we use JavaScript to draw the link and attach an "onclick" handler.[/i]

document.write ('<p><a href="#">More...</a></p>')

document.links[document.links.length - 1].onclick = function () {document.getElementById ('details23').className = ''}

// -->

</script>

<div id="details23">

Text Text Text Text Text Text Text Text Text Text Text

</div>

</body>

</html>[/font]
×

Success!

Help @weee 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.18,
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,
)...