You say that you are…
… wanting to add a random reason (quote) as to why they should join
which will change after every reload of the page
And you seem to trying to do this by placing Javascript in a text widget. I assume that is what you mean by the ‘”text” in the site’.
Based on that description, you don’t need Javascript. You need a new sidebar widget.
class Quote_Login extends WP_Widget {
/*constructs etc*/
function __construct($id = 'quologin', $descr="Quote Login", $opts = array()) {
$widget_opts = array();
parent::__construct($id,$descr,$widget_opts);
}
function widget() {
$ar = array(
'“Nothing is as easy as it looks.”',
'“Everything takes longer than you think.”',
'“Anything that can go wrong will go wrong.”',
'“If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong.”',
'“If there is a worse time for something to go wrong, it will happen then.”',
'“If anything simply cannot go wrong, it will anyway.”',
'“If you perceive that there are four possible ways in which a procedure can go wrong, and circumvent these, then a fifth way, unprepared for, will promptly develop.”',
'“Left to themselves, things tend to go from bad to worse.”',
'“If everything seems to be going well, you have obviously overlooked something.”',
'“Nature always sides with the hidden flaw.”',
'“Mother nature is a bitch.”',
'“It is impossible to make anything foolproof because fools are so ingenious.”',
'“Whenever you set out to do something, something else must be done first.”',
'“Every solution breeds new problems.”',
'“Trust everybody … then cut the cards.”',
'“Two wrongs are only the beginning.”',
'“If at first you don’t succeed, destroy all evidence that you tried.”',
'“To succeed in politics, it is often necessary to rise above your principles.”',
'“Exceptions prove the rule … and wreck the budget.”',
'“Success always occurs in private, and failure in full view.”',
);
$quote = $ar[array_rand($ar,1)]; ?>
<p><b>It looks like you haven’t logged in or have not yet registered.<br>
To receive the most accurate results and member benefits, login below or click register to become a member.</b></p>
<center>
<form action="wp-login.php" method="LINK">
<b><br><input type="submit" value="LOGIN"><br></b>
</form>
</center>
<p></p>
<b><p>Why Become A Member?</p>
<form name="random">
<input type="text" value="" size="78" name="random" />
</form>
<?php
// here is your quote
// the curly quotes you apparently want won't work in the form input
// but I don't know why you are shoving this into an input anyway
echo $quote; ?>
<p></p><center>
<form action="wp-register.php" method="LINK"><br>
<input type="submit" value="REGISTER"><br>
</form>
</center><p></p>
</b><p><b>XCLO</b></p> <?php
}
}
add_action('widgets_init', function() { register_widget("Quote_Login"); } );
You only need Javascript if you need the quote to change periodically without having the page reload.
I did not correct your basic markup (much) but a few things strike me as odd, such as the use of forms to create what are essentially links and the use of deprecated in HTML4 and unsupported in HTML5 elements like <center>