FrenkyB
FrenkyB

Reputation: 7197

How to add class to <style></style>

I would like to add css class inside a view and later call it.

Something like this:

<style>
  MarkSelectedRow {
    background-color: cornflowerblue;
  }
</style>

I was trying to call that class:

  var MarkSelected = function (element) {

    var tdCaller = $(element);
    tdCaller.addClass("MarkSelectedRow");

  }

But, nothing happens. It seems like class is not defined. Is it possible to define class inside <style></style> and later use it in code?

Upvotes: 1

Views: 58

Answers (1)

Italo Lemos
Italo Lemos

Reputation: 1022

You miss the dot:

<style>
   .class_name {
      background-color: cornflowerblue;
    }
</style>

Upvotes: 4

Related Questions