I have a bookmarking feature on my site, when the person clicks a paragraph, the box that is already hovering over that paragraph that reads "bookmark this" inserts "sweet man" in place of "bookmark this". so 'bookmark this' disappears and "sweet man" takes its place, how would i make it so when i click on the paragraph, it places 1 of 3 random phrases in there, lets say the 3 phrases are "success", "sweet man", and "awesome". here's a little bit of my code to show you where the random phrase would be placed.
$('p').click(function (e) {
var offset = $(this).offset();
var top = offset.top
if ($('#placeBookmark').hasClass('placing')) {
$('#placeBookmark').trigger('click')
$('#bookmark').css({left: offset.left - 30, top: top}).show();
$('#bookmarkThis').html('***SWEET MAN.***').delay(1000).fadeOut(400, function(){
$(this).html('BOOKMARK THIS')
})
}
});
See where in my code it says "SWEET MAN.", that's where the 1 of 3 random phrases should be placed after the user clicks the paragraph.
THANK-YOU
Edit
As a separate function:
Or with the phrases are arguments:
Use it like this:
or, when phrases are used as arguments: