Giving Style to an Appended Div Element

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Giving Style to an Appended Div Element

This post was updated on .
Hello. I tried using another support forum to add a rank system into my forum. However I would like to change the color of the text within post_count_js.

Here is my code:

<override_macro name="post_count_js"> 
    <n.param_loop. param="postCount"> 
                var $div = $('<n.page_user.user_tag_id/>');  
                $div.html('<n.one_or_many n="[n.page_user.post_count_value/]" one_text="[t]post[/t]" many_text="[t]posts[/t]"/>');  
                var postCount = <n.page_user.post_count_value/>;  
                if (postCount > 200)  
                    $div.append("Elite Member");  
                else if (postCount > 100)  
                else if (postCount > 50)  
                else if (postCount > 25)  

I already tried using `$ = 'color: blue' `however that did not work.

How can I change the color of each $div.append so they are different per rank? Thank you!