Questions tagged [class-names]

69 questions
0
votes
2 answers

How can I apply classNames in react to change the background color of one of the child div in React

I have 3 children divs wrapped in one parent div as shown : On click of each child div, I want its background-color to be changed to red. but if there is already one div with background-color red and some other div is clicked then its background…
Ajay Gaur
  • 4,400
  • 4
  • 31
  • 49
0
votes
1 answer

How to add classes to host in angular 2?

I need to add a class attribute dinamically the a host component made with Angular 2. What I want to do isn't this way: How to add "class" to host element? In the case above it would be necessary the hardcoding of the class. My objective is to add a…
Natanael
  • 1,900
  • 5
  • 21
  • 34
0
votes
2 answers

Derive a class name from another class name in template

In order to use a library, I need to use different classes that have the same base name. I.e. MyClass MyClassImpl PreMyClass And so on. in order to use them with template I need pass all these class names. template
Jepessen
  • 9,377
  • 11
  • 64
  • 111
0
votes
1 answer

Requiring a gem with a system class naming conflict

I'm writing a build script in Rake that uses a couple of 3rd party gems. One of these gem defines a class called Hash. class Hash alias hkeys keys def keys hkeys.sort {|a,b| a.to_s <=> b.to_s } end def each keys.each { |k| yield k,…
Coder1095
  • 778
  • 9
  • 21
0
votes
2 answers

Add/Remove multiple classes on multiple elements simultaneously

What I'm trying to achieve is using a single element, by onclick, is add and remove 2 class names on 2 independent elements simultaneously. Here is my element I'm using to trigger the js/jquery.
0
votes
5 answers

Use variable's string into class names or other

I want to use variables inside class names. For example, let's set a variable named $var to "index2". Now I want to print index2 inside a class name like this: controller_index2, but instead of doing it manually, I can just print the var name there…
0
votes
0 answers

Get all class names from element

What I am trying to achieve is just to get all class names which are used with a certain element. The problem is that when I use my various methods to get the class names, only the first class is being returned. Lets say I have a table, where each…
Phillip-juan
  • 546
  • 4
  • 27
0
votes
2 answers

load page according to class names

I've got code like this on my page:
I want something…
Hintswen
  • 3,847
  • 12
  • 36
  • 45
-1
votes
3 answers

JavaScript: How to get child-names of

I have a structure something like this:
abc
123 No my problem ist that I want to get the inner classNames 'E0' & 'GU' in javascript, and I only know the outer className…
1 2 3 4
5