I got a piece of code that display a random quote from a text file. It´s working fine. However I would like to style the authors name in bold. The text file “quotes.txt” looks like this:
Because we’re friends, I’m gonna tell you something nobody else knows. I’m homophobic. Author@
Cookies, everyone! Nourishment is most important in the morning. Author@
Objection, your Honor. You can’t preface your second point with “first of all.” Author@
Denny Crane. Author@
You know what I’m going to do, Brian, just to show you there are no hard feelings? I’m going to sleep with your wife. Author@
Did something happen? Was I in the room when it happened? Author@
jQuery:
<script type="text/javascript">
$(document).ready(function() {
$.get('path/to/RandomQuote.txt', function (data) {
var quotes = data.split("\@");
var idx = Math.floor(quotes.length * Math.random());
$('.quotes').html(quotes[idx]);
});
});
</script>
replace
using this,