/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] onclick hide div

[CODE]<div id=”locLookupDiv” style=”position: absolute; z-index: 20; visibility: hidden; width: 360px; background-color: #FFFFFF; border: 1px solid #000000;”></div>[/CODE]

Is there not an easy way to do an onclick for a div? I just want to be able to hide the div when it is clicked.

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@KorOct 22.2007 — with javascript:
<i>
</i>&lt;div onclick="this.style.visibility='hidden'"&gt;&lt;/div&gt;
Copy linkTweet thisAlerts:
@altauthorOct 22.2007 — EZ nuff. Thanks haha.
Copy linkTweet thisAlerts:
@EliteGhostAug 23.2009 — I want to do this exact same thing but not in the same div. id be clicking a img or inside of a <td> on the click of that i want the content in <div> further below to be hidden or changed to blank
Copy linkTweet thisAlerts:
@EliteGhostAug 23.2009 — okay, i have successfully hidden the content !! lol. i just said that id.style.hidden on the click of the td.

but that isnt what i wanted nessisarily. i want my box to colapse. so its not just hidden, its not there. and i have want to be able to un-hide my content.
×

Success!

Help @alt 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...