Reputation: 345
I would like to dynamically update <h1>
text to include <span></span>
tags.
My jsfiddle shows javascript that looks like this:
$("h1").text("Time Left:<span>" + padNum(glob.gameTimer) + "</span>Best:
<span>" + padNum(glob.bestTime) + "</span>Reaction Time:<span>" +
padNum(glob.reactionTime) + "</span");
Upvotes: 3
Views: 49
Reputation: 563
Use html
instead of text
$("h1").html("Time Left:<span>" + padNum(glob.gameTimer) + "</span>Best:<span>" + padNum(glob.bestTime) + "</span>Reaction Time:<span>" + padNum(glob.reactionTime) + "</span");
Upvotes: 1