mercredi 21 octobre 2015

Error in js "cant find whats wrong"

Yes, I know quote is spelled qoute I will fix that later. This code is supposed to work when I click a button it show an inspirational quote, but when I click, it does not show the random array!

<!DOCTYPE html>
<html>
<head>
    <link href="style.css" rel="stylesheet" type="text/css">
    <title>Finger Game</title>
    <meta charset="utf-8">
    <meta content="text/html; charset=utf-8" http-equiv="Content-type">
    <meta content="width=device-width, initial-scale=1" name="viewport">
</head>
<body>
    <div style="text-align: center">
        <header></header>
        <div id="form">
            <button id="myButton">Submit</button>
        </div>
        <div id="qoute"></div>
        <script type="text/javascript">
var qoute = ["ba", "ba", "ba"]
 x = Math.random()
 x = 5 * x;
 document.getElementById("myButton").onclick = document.getElementById(qoute).innerHTML = quote(x);

</script>
    </div>
</body>
</html>




Aucun commentaire:

Enregistrer un commentaire