Hide Div with Class Name Having Space in It Using Jquery
This Is My Div. I Want to Hide the Div Using the Class Name. I Am Not Able to Do as Class Name as Space in It. It Is Only One Class. 1 3 Answers Class Names...
<div class="rcbScroll rcbWidth rcbNoWrap" style="height: 200px; width: 100%; overflow: auto"> </div>
This is my div. I want to hide the div using the class name. I am not able to do as class name as space in it. It is only one class.
3 Answers
Class names can not have spaces in them. So you have to think of it as 2 class names.
Eg: class="word1 word2"
Can be selected with the following:
var myVar = $('.word1.word2');
In your specific case, it becomes:
$('.rcbScroll.rcbWidth.rcbNoWrap').hide();
The spaces means multiple class names, you can use any of these classes to hide the div.
Example:
$(".rcbScroll").hide()
You can use dot to join multiple classes in selector being separated by space character.
$(".rcbScroll.rcbWidth.rcbNoWrap").hide();