MrSmitt,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
$.fn.factorial = function(m_x) {
function f_Factorial(m_x) {
if (m_x == 0 || m_x == 1) return 1;
else return m_x * f_Factorial(m_x - 1)
}
var Factorial = f_Factorial(m_x);
return this.length ? $(this).text(Factorial) : Factorial
};
$("div").factorial(5).css({
color: "#FF0000"
});
$("p").text($.fn.factorial(4)).css({
color: "#FF00FF"
})
});
</script>
</head>
<body>
<div></div>
<div></div>
<p></p>
<p></p>
</body>
</html>