0
我有一个字符串数组,我想在按键上一次显示一个字符串。我有一个空格与歌词类。使用按键显示字符串数组jquery
$(document).keyup(function(e){
if (event.which==13)
...
我只是在这里的语法混淆,我将如何指定此事件打印我的数组我的div。我离开了这里大部分我的剧本的,因为这是我需要
帮助这里的唯一部分是HTML只是一个基本的布局
<html>
<head>
<meta charset="UTF-8">
<title>Rotating Messages</title>
<link href="stylesheets/site.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
var messages=[
"Tonight I\'m gonna have myself a real good time",
"I feel alive and the world it\'s turning inside out Yeah!",
"I\'m floating around in ecstasy",
"So don\'t stop me now don't stop me",
"Cause I\'m having a good time having a good time",
"I\'m a shooting star leaping through the skies",
"Like a tiger defying the laws of gravity",
"I\'m a racing car passing by like Lady Godiva",
"I'm gonna go go go",
"There\'s no stopping me"
];
</script>
</head>
<body>
<div id="wrapper">
<header class="title">
<h1> Fun with Arrays!</h1>
<div class="lyrics"></div>
...
我只是很困惑如何使用按键打印到空div
也张贴您的HTML代码。 –
您正在使用'e',然后使用'e.which' –