forwarding onto [email protected]

---------- Forwarded message ----------
From: Martin Grigorov <[email protected]>
Date: 8 April 2015 at 08:36
Subject: Re: how change a HTML class with javascript
To: dev <[email protected]>


Hi,

This is a question for users@ mailing list.

On Tue, Apr 7, 2015 at 6:06 PM, matias nahuel heredia <
[email protected]> wrote:

> hi!i must change a class with javascript
> public String helloWorld(                       final
> @ParameterLayout(named="name",cssClass="unaclase") String nameOfLove     )
>      {               return "ok";    }
> i change in the css the color of the class and works normaly
> .unaclase{color:blue;}
> but i can“t modify the color for example whit javascript like this
>  $(document).ready(function() {
> document.getElementById("unaclase").setAttribute("style",
> "background-color: #000000; width: 200px; height: 100px;");});
>

You should use #getElementsByClassName()[0]. Even better use jQuery:
$('.unaclase').css({....})


> the question is how can i remplaze this using javascript?
>

Reply via email to