How would you refer to javascript function directly in html?
<p>So the idea is this. I have an array in the js file as well as a function that refers to a random element from that array. I want to be able to click a button and the text in the span changes to a random element in the array.
I already have a way of doing this. I have a span with an id of "change_equivalently". Then in the javascript file, I have</p>

<pre><code>var Equivalentlys = [
"Equivalently, ",
"Alternatively, ",
"Another way of saying this is that "
];

$('#shuffle').click(function() {
    var length = (Equivalentlys.length + 1);

    var x = Math.floor(Math.random()*length);

function Equivalently(i){
    return Equivalentlys[i];
};

$('#change_equivalently').text(Equivalently(x));

});
</code></pre>

<p>My question is that when I write out the html code, I always have to write</p>

<pre><code>&lt;span id = "change_equivalently"&gt; ... &lt;/span&gt;
</code></pre>

<p>in order to be able to change the words up upon clicking the button.</p>

<p>But I want an easier way.
I tried something like</p>

<pre><code>  &lt;var&gt; Equivalently( 1 ) &lt;/var&gt; 
</code></pre>

<p>to see if I could refer to the javascript function, but it didn't work.</p>

<p>How could I go about approaching this?</p>
