此代码用于在每次加载时更改页面上的引号,但段落仍为空。
<script>
(function() {
var quotes = [
{
text: "This is the first possible quote”"
},
{
text: "This is the second possible quote”"
},
{
text: "This is the third possible quote”"
}
];
var quoteUse = quotes[Math.floor(Math.random() * quotes.length)];
document.getElementById('quote').innerHTML=quoteUse.text;
})();