Attach events to Simon module; still waiting on arrows

This commit is contained in:
Daniel Sinn
2015-11-29 17:30:44 -05:00
parent 302cff7f89
commit f7fc253724
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -58,7 +58,7 @@
<ul>
<li>
<input type="radio" name="simonStrikes" value="0" id="simonStrikes0" />
<input type="radio" name="simonStrikes" value="0" id="simonStrikes0" checked />
<label for="simonStrikes0">0 strikes</label>
</li>
<li>
+16
View File
@@ -166,6 +166,22 @@ $('.jsResetSection').on('click', function () {
});
})();
(function () {
/**
* Simon
*/
var $checkbox = $('#simonVowel'),
$strikeButtons = $('#sectionSimon input[name="simonStrikes"]');
$('#sectionSimon input').on('change', function () {
var hasVowel = $checkbox.prop('checked'),
strikes = $strikeButtons.filter(':checked').val();
// Do something with arrows and stuff!
console.log({vowel: hasVowel, strikes: strikes});
});
})();
(function () {
/**
* Memory