Somnath Kharat Somnath Kharat - 7 months ago 13
Javascript Question

Hide div with class name having space in it using 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.

Answer

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();
Comments