<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body{background:#ccc;}
</style>
</head>
<body>
<form name="name1" method="post" id="name1">
<select class="select1" id="selectid" name="selectuser" onChange='Choice();'>
<option>Your text</option>
<option value="1">English</option>
<option value="2">French</option>
<option value="3">German</option>
<option value="4">Turkish</option>
<option value="5">Slovak</option>
<option value="6">Spanish</option>
</select>
<input class="input1" id="ids" name="id" onkeyup="getVal()" type="text" o>
<input type="button" value="Submit" name="B1" onclick="getText()">
</form>
<div id="icard" class="drag" style="left: 0px; top: 0px; width:10%; height:10%;"></div>
<audio id="audio">
<source src='http://www.mediacollege.com/downloads/sound-effects/hit/hit-01.wav' type="audio/mpeg" />
</audio>
<audio id="audio2">
<source src='http://www.mediacollege.com/downloads/sound-effects/hit/hit-pipe.wav' type="audio/mpeg" />
</audio>
<script language="JavaScript">
function getText() {
var myString = document.name1.ids.value.toLowerCase();
var list3 = myString.split('')
var list1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
var list2 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', "ı", 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
for (var i = 0; i < list3.length; ++i) {
setTimeout(playOne.bind(null, list3[i]), i*550);
document.getElementById('icard').innerHTML = i;
document.body.style.backgroundColor = '#' + Math.random().toString(16).slice(2, 8);
}
function playOne(entry) {
if (list1.indexOf(entry) >= 0) {
setTimeout(audio.play(null, list1[i]), i*550);
document.getElementById('icard').innerHTML = i;
document.body.style.backgroundColor = '#' + Math.random().toString(16).slice(2, 8);
} else if (list2.indexOf(entry) >= 0) {
setTimeout(audio2.play(null, list2[i]), i*550);
document.getElementById('icard').innerHTML = i;
document.body.style.backgroundColor = '#' + Math.random().toString(16).slice(2, 8);
}
}
}
</script>
<script>
var ids = new Array();
ids[0] = "";
ids[1] = "hello";
ids[2] = "salut";
ids[3] = "hallo";
ids[4] = "merhaba";
ids[5] = "ahoy";
ids[6] = "ola";
function Choice() {
y = document.getElementById("selectid");
document.getElementById("ids").value = ids[y.selectedIndex];
}
</script>
<script>
var audio = document.getElementById('audio');
var audio2 = document.getElementById('audio2');
</script>
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |