You cannot change the attributes of an element using CSS; you could possibly emulate the functionality of the title , though (albeit awkwardly):
.note { position: relative; } .note:after { content: "The alternate 'pseudo-title' text for the .note elements."; position: absolute; left: 50%; background-color: #000; color: #fff; }
JS Fiddle demo .
However, using this parameter will still allow you to show the original title , so I would suggest removing this attribute using JavaScript (or in a server-side language).
Possible way to remove JavaScript header:
var notes = document.getElementsByClassName('note'); var notesNum = notes.length; for (i=0; i<notesNum; i++){ notes[i].removeAttribute('title'); }
JS Fiddle demo (combining two approaches) .
Edited because the OP, from the comments (below), does not want to change the existing appearance, add a JavaScript parameter to assign a new title to all elements with the class name note :
var notes = document.getElementsByClassName('note'); var notesNum = notes.length; var newTextForNotesClass = "This is the new title text for the notes-class-name group."; for (i=0; i<notesNum; i++){ notes[i].title = newTextForNotesClass; }
JS Fiddle demo .
source share