Add a CSS class from jQuery (both external files) -


how add css class (external style sheet) jquery (external javascript file)?

here jquery code:

$(this).addclass('myclass'); 

and here css code:

.myclass{     background-color: blue; } 

here file structure:

c:. └───myproject     │   index.html     │     ├───resources     │   ├───css     │   │       style.css     │   │     │   └───js     │           script.js     │     └───vendors         │         ├───jquery         │       jquery-1.11.2.min.js 

and here html link tags:

<link rel="stylesheet" href="resources/css/style.css" />    <script src="vendors/jquery/jquery-1.11.2.min.js"></script>    <script src="resources/js/script.js"></script> 

it doesnt matter how file structure is. long loading css correctly style applied html.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -