How do I make a javascript function a html attribute?
问题 I have a javascript variable with parameters, but I don't know how to pass it into my html code. The javascript code is taken from https://gist.github.com/EvanHahn/2587465: var caesarShift = function(str, amount) { // Wrap the amount if (amount < 0) return caesarShift(str, amount + 26); // Make an output variable var output = ''; // Go through each character for (var i = 0; i < str.length; i ++) { // Get the character we'll be appending var c = str[i]; // If it's a letter... if (c.match(/[a-z