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

1
  • 2
    Class names cannot have spaces in them. Spaces denote separate classes. Commented Mar 29, 2013 at 6:18

3 Answers 3

14

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();
Sign up to request clarification or add additional context in comments.

Comments

4

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

Example:

$(".rcbScroll").hide()

Comments

2

You can use dot to join multiple classes in selector being separated by space character.

Live Demo

$(".rcbScroll.rcbWidth.rcbNoWrap").hide();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.