/    Sign up×
Community /Pin to ProfileBookmark

Changing Style Classes

I currently have these 2 styles on a .css file

[code=php]
table.contacts

{font-family: Verdana;
font-size: 8pt;
border-right: 1px #ff00ff solid;
background-color: #ffaaff;}

table.contactsDisabled

{font-family: Verdana;
font-size: 8pt;
border-right: 1px #ff00ff solid;
background-color: #cc99ff;}
[/code]

Is there any way that I can add both of these classes to a table tag and then change them as the specific div tag is disabled or enabled?

(i.e. class=”contacts” is the main class but when I disable the div tag which surrounds this table I want the class to change to class=”contactsDisabled”)

Is this possible?

Regards

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@PittimannFeb 23.2004 — Hi!

Just assign the class contacts to the table tag on startup; then you will have to use

class[COLOR=limegreen]Name[/COLOR]="contactsDisabled" in js...

Cheers - Pit
Copy linkTweet thisAlerts:
@chrizFeb 23.2004 — You could try this but i'm not sure if it works :

[COLOR=darkblue]

<script kanguage="javascript">

var table1 = "<table><tr><td class="contacts">enabled</td></tR></table>";

var table2 = "<table><tr><td class="contactsdisabled">disabled</td></tr></table>";



if(document.frm1.chk1.checked)

document.write(table1)

else

document.write(table2)



</script>

<form name="frm1">

<input type="checkbox" name="chk1">Enabled

</form>

[/COLOR]


Here you would have to position the checkbox etc. on the page, but once the checkbox is selected it changes the css style of the table cell

Tell me if it works

You may need to re-positions the table and checkbox though.

Sorry about that bit.
Copy linkTweet thisAlerts:
@BurrowsNo1FanauthorFeb 23.2004 — Thank You Pittiman

That's worked great!!



Regards
Copy linkTweet thisAlerts:
@PittimannFeb 23.2004 — Hi!

You're welcome!! ?

Cheers - Pit
×

Success!

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