how to add and remove class using jquery
<script>
function addcls(){
$("#name").attr("class","classname1 classname2");
}
function removeclass(){
$("#name").removeAttr("class")
}
</script>
Name :
<input type="text" name="name" id="name" value="my name" onclick="(this.value='')" /><br />
<input type="button" onclick="addcls()" value="Add Class" />
<input type="button" onclick="removeclass()" value="Remove Class" />
Comments
Post a Comment
If you Satisfied , Please Leave a comment