Reputation: 2387
How do I change text with TM character entity in the text, with jquery?
For example :
TM = ™ ; ™
<h1>Some text™</h1>
Now I want to change text on button click to 'This is some other text™'
$('#click1').on('touchend', function () {
$('h1').text("This is some other text");
});
How can I place the ™ with jquery and how can I place it in <sup></sup>
?
Upvotes: 0
Views: 326
Reputation: 4968
Use .html
instead of .text
:
$('h1').html('This is some other text ™');
Upvotes: 1
Reputation: 77482
Try this
$('h1').html("This is some other text <sup>™</sup>");
Upvotes: 1