html - Adding CSS via Javascript -


i trying add css styling (in addition styles in place) via javascript (simply because not have access main css file)

http://jsfiddle.net/pbpyu/

html:

<a class='store-locator-button'>replace me</a> 

javascript:

$(function() { $('.store-locator-button').addclass('tempstorebutton'); $("a.store-locator-button").each(function(index,el){     $(el).text('buscar una tienda');   });  }); 

css:

.tempstorebutton{padding:5px; color:#fa5dae;} 

it works fine in jsfiddle, not on site. suggestions?

the order in css applied important. should add javascript code @ bottom of page make sure gets applied in case other styles applied before hand. try !important property in case css overriden.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -