我正在尝试在"播放器"div中显示图像,然后在访问者单击按钮后,将其替换为视频(将div替换为iFrame).这是我的代码:
<!DOCTYPE html>
<head>
<style type="text/css">
html {
text-align: center;
}
#player {
display: inline-block;
width: 640px;
height: 360px;
background: url(http://placehold.it/640x360) no-repeat;
}
</style>
</head>
<html>
<body>
<!-- 1. The <iframe> (and video player) will replace this <div> tag. -->
<div id="player"></div>
<p><button onclick="playMe()">Play</button></p>
<script>
function playMe() {
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and …Run Code Online (Sandbox Code Playgroud) 我有下表,需要找到
JSFiddle
代码
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.text-bold { font-weight: 700; }
table {
margin: 16px 0;
color:#333;
border-width: 1px;
border-color: #666;
border-collapse: collapse;
}
table th {
border-width: 1px;
padding: 4px;
border-style: solid;
border-color: #666;
background-color: #FBDD9B;
}
table td {
border-width: 1px;
padding: 4px;
border-style: solid;
border-color: #666;
background-color: #fff;
}
</style>
</head>
<body>
<table id="table-results">
<tr>
<th>Question</th>
<th>inovation</th>
<th>all-round</th>
<th>coordination</th>
<th>keeper</th>
<th>analytic</th>
</tr>
<tr> …Run Code Online (Sandbox Code Playgroud) 我有这样的数组
var Data = [{
"words": [
"dolor",
"sit",
"amet",
"consectetur"
],
"description": "Lorem Ipsum."
}, {
"words": [
"adipisicing",
"elit",
"sed",
"do"
],
"description": "Lorem Ipsum."
}];
Run Code Online (Sandbox Code Playgroud)
如何将所有单词连接成一个字符串,用单个管道符号"|"分隔 ?期望的输出应如下所示:( dolor | sit | amet | consectetur | adipisicing | elit | sed | do)