This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Set css values dinamically pressing buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Set css values dinamically pressing buttons" Watch "Set css values dinamically pressing buttons" New topic

Set css values dinamically pressing buttons

Dura Hurtado
Ranch Hand

Joined: Feb 16, 2011
Posts: 120
Hi, which I am trying to do is as follows, and I don´t know if it is possible, well the thing is that I would like build a .css dinamically,

I mean load a .css with the properties reset, and be able to set color=red, pressing a button, using a back bean like in JSF, that way I would write 'red' in an input text(#{Content.color}) in the .xhtml file, and would retrieve the value from the .css the same way using jquery

I know the question is a little confusing but I am googling about it but I haven´t clear my ideas about.

¿Any clue?

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

I can't tell what you are actually asking, and bringing in JSF-specific concepts in this forum will not be helpful, but you can dynamically add styles to elements, as well as change their class list with jQuery. These are the supported ways of changing the styles of elements.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Set css values dinamically pressing buttons
jQuery in Action, 3rd edition