Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide div with class name having space in it using jquery

Tags:

html

jquery

<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.

like image 656
Somnath Kharat Avatar asked Mar 29 '13 06:03

Somnath Kharat


2 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();
like image 120
Hugo Dozois Avatar answered Oct 05 '22 09:10

Hugo Dozois


The spaces means multiple class names, you can use any of these classes to hide the div.

Example:

$(".rcbScroll").hide()
like image 25
ATOzTOA Avatar answered Oct 05 '22 08:10

ATOzTOA