/    Sign up×
Community /Pin to ProfileBookmark

want to check visible status and then..

Hi

Using javascript i want to check that

tag is visible to true or not.

when i click on button then

if tag is visible then i want to hide it.

and if tage is hidden then i want to show it.

please help me.

regards,
ASIF

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@QuentinNov 27.2006 — Here is an example of what I think you are trying to achieve let me know if I'm on the right track:

<script type="text/javascript">
function ToggleTag() {
var tag = document.getElementById("tag");

<i> </i>if (tag.style.visibility == "visible") {
<i> </i> tag.style.visibility = "hidden";
<i> </i>} else {
<i> </i> tag.style.visibility = "visible";
<i> </i>}
}
&lt;/script&gt;

&lt;p id="tag" style="visibility: visible;"&gt;This is the Tag&lt;/p&gt;
&lt;input type="button" value="Toggle Tag" onclick="ToggleTag()" /&gt;


This can also be done with the display style by setting it to none and then back to inline or block depending on the HTML element your changing.
×

Success!

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