Add Class - Jquery

How to add class in jquery

Snippet Code


  
Rate this page :
  [ 0 votes]

Here the new class "demo" is added using addclass function.

$(document).ready(function(){ $("#test").addClass("demo");//To add class "demo" to <div> tag. }); <div id='test'>Welcome to hiox</div> <style> .demo{font-weight:bold;font-size:1.2em;color:red;font-style:italic;} </style>

Tags


Ask Questions

Ask Question