SO43666444

for http://stackoverflow.com/questions/43666444/

by Stephen

HTML

<div class="container">
    <div class="card fade-in">
        <p id="randomStrategy"></p>
        <input type="button" id="pickrandom" value="Click Me">
    </div> <!-- /card -->
</div> <!-- /container -->


<script>
document.getElementById('pickrandom').addEventListener('click', pickAStrategy);

function pickAStrategy()
{
    var chosenStrategy = strategies[Math.floor(Math.random() * strategies.length)];
    //console.log('chosen: ' + chosenStrategy);
    document.getElementById('randomStrategy').innerHTML = chosenStrategy;
}

var strategies = [
    "Abandon desire",
    "Abandon normal instructions",
    "Accept advice",
    "Adding on",
    "A line has two sides",
    "Always the first steps",
    "Ask people to work against their better judgement",
    "Ask your body",
    "Be dirty",
    "Be extravagant",
    "Be less critical",
    "Breathe more deeply",
    "Bridges -build -burn",
    "Change ambiguities to specifics",
    "Change nothing and continue consistently",
    "Change specifics to ambiguities",
    "Consider transitions",
    "Courage!",
    "Cut a vital connection",
    "Decorate, decorate",
    "Destroy nothing; destroy the most important thing",
    "Discard an axiom",
    "Disciplined self-indulgence",
    "Discover your formulas and abandon them",
    "Display your talent",
    "Distort time",
    "Do nothing for as long as possible",
    "Don’t avoid what is easy",
    "Don’t break the silence",
    "Don’t stress one thing more than another",
    "Do something boring",
    "Do something sudden, destructive and unpredictable",
    "Do the last thing first",
    "Do the words need changing?",
    "Emphasise differences",
    "Emphasise the flaws",
    "Faced with a choice, do both (From Dieter Rot.)",
    "Find a safe part and use it as an anchor",
    "Give the game away",
    "Give way to your worst impulse",
    "Go outside. Shut the door.",
    "Go to an extreme, come part way back",
    "How would someone else do it?",
    "How would...

CSS

p#randomStrategy {
  min-height: 14px;
  min-width: 23px;
  border: 1px dotted green;
}