-4

I have <tr class="task"title="Edit"> How can I transfer title to css class like this

tr.task{
title="Edit";
}
Maksims
  • 167
  • 2
  • 11

2 Answers2

1

You would need to use jQuery to change the title property.

$('.task').prop('title', 'your new title');

Or the title attribute:

$('.task').attr('title', 'your new title');

Read about the differences here: .prop() vs .attr()

Community
  • 1
  • 1
tigerdi
  • 612
  • 7
  • 13
  • Maybe you know, how I can transmit not $('.task-row-link').attr('title', 'Edit'); but $('.task-row-link').attr('title', '@Shop.Resources.Properties.Literals.Edit'); – Maksims Feb 16 '17 at 14:32
  • You should be able to add that title using the way described. See JSFiddle https://jsfiddle.net/jamesbr139/3xj6b4sw/ – tigerdi Feb 16 '17 at 15:23
0

It is beyond the capabilities of CSS to change title, but if you're looking to select tr.task with the title "Edit", here's how you can do that using attribute selectors

tr.task[title="Edit"]

Luke Clynes
  • 195
  • 1
  • 10