/    Sign up×
Community /Pin to ProfileBookmark

using getId with a passed string

I want to click an image of a calendar and have 2 hidden divs show up, so far one div is showing up but not the second.

In my a tag:

[code]<a href=”javascript:showCal(‘start’,’editStart’)”>
<img class=”icon” alt=”edit start date” src=”http://legalconference.com/images/calendar.gif” />
</a>[/code]

Here’s the javascript it calls:

[code]function showCal(start, calID) {
document.getElementById(“dimPage”).style.visibility = “visible”;
document.getElementById(calID).style.visibility = “visible”;
}[/code]

The first one is working because I directly type in the string “dimPage” but the second one is trying to use a passed string variable and I must be doing that wrong.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @eTech1 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.29,
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,
)...