I want to use jQuery to add a class named container-c-ml to my HTML code. I have the following code below:
<div id="container">
<button>This is a button</button>
</div>
I have my HTML doc linked to a JavaScript file and I have jQuery added via the <head> tag of my doc. What should I do?
>Solution :
You can use the following jQuery code:
$(document).ready(function() {
$("#container").addClass("container-c-ml");
});
Good luck with further learning to code!