<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<form name='myform' action='' method='post'>
<select id="likeShield" onchange="checkAll()">
<option value="select1">Select</option>
<option value="yesShield">Yes</option>
<option value="noShield">No</option>
</select>
<select id="chooseShield" onchange="checkAll(document.myform.cb)">
<option value="select1">Select</option>
<option value="arc">Arcane</option>
<option value="ely">Elysian</option>
<option value="spec">Spectral</option>
<option value="anylist">Choose any</option>
</select>
<table border = "1">
<tr>
<th> tickbox </th>
<th> shield parts </th>
<th> description </th>
<th> cost </th>
</tr>
<tr>
<td><input type="checkbox" name='cb' id="cb1"></td>
<td> arc sigil </td>
<td> Large magic part </td>
<td> 5m </td>
</tr>
<tr>
<td><input type="checkbox" name='cb' id="cb2"></td>
<td> arc shield </td>
<td> A extremely powerful magic shield </td>
<td> 60m </td>
</tr>
<tr>
<td><input type="checkbox" name='cb' id="cb3"></td>
<td> arc special item </td>
<td> special element </td>
<td> 10m </td>
</tr>
<tr>
<td><input type="checkbox" name='cb' id="cb4"></td>
<td> elysian sigil </td>
<td> A sigil found by dragons </td>
<td> 50m </td>
</tr>
<tr>
<td><input type="checkbox" id="cb5"></td>
<td> elysian shield </td>
<td> A extremely powerful ranging shield </td>
<td> 40m </td>
</tr>
<tr>
<td><input type="checkbox" id="cb6"></td>
<td> elysian special item </td>
<td> A special attack attached to shield </td>
<td> 25m </td>
</tr>
<tr>
<td><input type="checkbox" id="cb7"></td>
<td> spectral sigil </td>
<td> easily obtainable from goblins </td>
<td> 4m </td>
</tr>
<tr>
<td><input type="checkbox" id="cb8"></td>
<td> spectral shield </td>
<td> Impressive stats </td>
<td> 15m </td>
</tr>
<tr>
<td><input type="checkbox" id="cb9"></td>
<td> spectral special item </td>
<td> Does double damage </td>
<td> 30m </td>
</tr>
</table>
</form>
</body>
</html>
var likeShield = document.getElementById('likeShield');
var chooseShield = document.getElementById('chooseShield');
function checkAll(){
if(likeShield.value=="noShield" && chooseShield.value=="arc"){
document.getElementById('cb1').checked =true;
document.getElementById('cb2').checked =false;
document.getElementById('cb3').checked =false;
document.getElementById('cb4').checked =false;
document.getElementById('cb5').checked =false;
document.getElementById('cb6').checked =false;
document.getElementById('cb7').checked =false;
}
if(likeShield.value=="noShield" && chooseShield.value=="ely"){
document.getElementById('cb1').checked =false;
document.getElementById('cb2').checked =false;
document.getElementById('cb3').checked =false;
document.getElementById('cb4').checked =true;
document.getElementById('cb5').checked =false;
document.getElementById('cb6').checked =false;
document.getElementById('cb7').checked =false;
}
if(likeShield.value=="noShield" && chooseShield.value=="spec"){
document.getElementById('cb1').checked =false;
document.getElementById('cb2').checked =false;
document.getElementById('cb3').checked =false;
document.getElementById('cb4').checked =false;
document.getElementById('cb5').checked =false;
document.getElementById('cb6').checked =false;
document.getElementById('cb7').checked =true;
}
if(likeShield.value=="noShield" && chooseShield.value=="anylist"){
document.getElementById('cb1').checked =false;
document.getElementById('cb2').checked =false;
document.getElementById('cb3').checked =false;
document.getElementById('cb4').checked =false;
document.getElementById('cb5').checked =false;
document.getElementById('cb6').checked =false;
document.getElementById('cb7').checked =false;
}
}
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. |