Q:

Add html to jquery text function

I am editing the wordpress js and was unable to do so as I am not a jquery expert so i decided to post question here i am wondering to set the font size of AM or PM to small but in js the html is not working i know that would be possible as when i place html tags it is not converting just showing as html output 
$time.text(hours + ":" + minutes +  ampm);

at the place of ampm i would like to wrap it up with  si i tried to do like this 
$time.text(hours + ":" + minutes +"<p class='small'>" + ampm + "</p>");

the output is coming as 
03:25 <p class='small'> PM </p>

so the html is harcoded not converting can anyone help me out with this concern ?

A:

change .text to .html:-
$time.html(hours + ":" + minutes +"<p class='small'>" + ampm + "</p>");

jQuery Docmentation
.text = Set the content of each element in the set of matched elements to the specified text.
.html = Set the HTML contents of each element in the set of matched elements.

A:

.html() treats/interpret the string as HTML whereas .text() treats the content as text
Thus you need to use.html() instead of .text():
$time.html(hours + ":" + minutes +"<p class='small'>" + ampm + "</p>");

