How do I change the below javascript to change my css class, rather than add/append to it?
<script type="text/javascript">
(function($){
$(document).ready(function(){
$('ul#horizontal.nav.menu').addClass('myNewClass');
});
})(jQuery);
</script>
EDIT
I am trying to change the following UL:
<ul class="nav menu" id="horizontal">
to
<ul class="myclass" id="horizontal">
I have tried the following just before my closing </body> tag and not working:
<script type="text/javascript">
(function($){
$(document).ready(function(){
// add items for bootstrap dropdown's
$("#horizontal").attr("class", "myclass");
})(jQuery);
</script>
$variable within the function will not conflict with any other library.navor.menu. or prefixing withul.. I may be wrong but I don't recommend it. Then you should do like thisdocument.getElementById('horizontal').className = "myNewClass";