2
It is possible with javascript to add an element to a class?
EX: Have a class:
.post_22 {color:red}
Until then it only has color, but when you click on a link:
<a onclick="minBox()">Seu Poste</a>
could add the CLASS post_22 another style?
I know you can use it with css()
, but on the screen there is a setInterval
, which means that when it refreshes again it would remove the css()
which would be assigned to the class via css(), in which case the direct assignment to the class would not be removed in the next setInterval
.
Remembering that the class post_22
There is no actual css file, it can be post_1
, post_2
, post_3
.... This comes according to the ID
on the server linked to the post.
If on the server the ID
pole: "Hello my friend." for "ID: 66" it generates the class post_
and together with the ID post_66
You can put an example on https://jsfiddle.net and share?
– user3603
I don’t see how to create an example of this. What I really need is that when you click on the link <a onclick="minBox()">Your Post</a> a style is added directly to a class.. instead of user css() that falls into the "style attribute".
– Pedro Quezado
You are using jQuery?
– user3603
yes, @Gerep got the idea?
– Pedro Quezado
You want to add a new class
CSS
on your link, that’s it?– user3603