JavaScript toggle div with a class name derived from a parameter toggle with class,toggle class with animation,toggle class with

I am having a JavaScript function where the classname comes as a parameter. So i want to toggle() the specific class name which came in the parameter. How should i do this? I tried like this but it doesnt work.

function hideclass(classval){
$("#divname.classval").toggle();
}
Answer:1

try this

 function hideclass(classval){
    $("#divname."+classval).toggle();
 }

or

function hideclass(classval){
    $("#divname").hasClass(classval).toggle();
 }
Answer:2

I want to make set with for my own objects witch can recognize same objects at append and falls them. function ImageSet(){ this.set = []; } ImageSet.prototype.length = function(){return this.set....

I want to make set with for my own objects witch can recognize same objects at append and falls them. function ImageSet(){ this.set = []; } ImageSet.prototype.length = function(){return this.set....

  1. classroom
  2. class dojo
  3. classlink
  4. classpass
  5. classic firearms
  6. classical music
  7. classroom google
  8. classic minecraft
  9. classcraft
  10. classical conditioning
  11. classic christmas movies
  12. classic cars for sale
  13. classic movies
  14. class act
  15. classmates
  16. classroom timer
  17. classic industries
  18. classroom screen
  19. classic cars
  20. classic christmas songs

<form id="QandA" action="<?php echo htmlentities($action); ?>" method="post"> <table id="question"> <tr> <td colspan="2"> <a onclick="return ...

<form id="QandA" action="<?php echo htmlentities($action); ?>" method="post"> <table id="question"> <tr> <td colspan="2"> <a onclick="return ...

  1. disable onclick event jquery
  2. disable onclick event javascript
  3. disable onclick event react
  4. disable onclick event css
  5. disable onclick event anchor tag
  6. disable onclick event after first click
  7. disable onclick event js
  8. disable onclick event image javascript
  9. disable onclick event android
  10. disable onclick event on div
  11. disable onclick event html
  12. disable onclick event button
  13. disable onclick event using jquery
  14. disable onclick event image jquery
  15. disable onclick event listener
  16. disable onclick event delphi
  17. disable enable onclick event javascript
  18. disable all onclick events
  19. disable enable onclick event jquery
  20. disable button onclick event jquery

Phonegap 2.1 iOS 6 jQuery 1.7.2 JQMobile 1.1.1 I have a phonegap app that seems to be caching old data from ajax responses if I don't use the app for a few days. I have to reinstall the app to clear ...

Phonegap 2.1 iOS 6 jQuery 1.7.2 JQMobile 1.1.1 I have a phonegap app that seems to be caching old data from ajax responses if I don't use the app for a few days. I have to reinstall the app to clear ...

How do i run an animation(like changing CSS properties) in native javascript without using jQuery library's animate method?? I have tried jQuery library animate and the framerate interval changes to ...

How do i run an animation(like changing CSS properties) in native javascript without using jQuery library's animate method?? I have tried jQuery library animate and the framerate interval changes to ...

  1. native javascript animation