You have to be logged in to leave a comment.
Sign In
1
<p>1. Use <strong>jQuery</strong> to detect when any of the buttons are <strong>clicked</strong> and trigger a <strong>handler function</strong>.</p><p>2. <strong>Inside</strong> the handler, create a new variable called <code>userChosenColour</code> to store the <strong>id</strong> of the button that <strong>got clicked</strong>. </p><p>--> So if the Green button was clicked, <code>userChosenColour</code> will equal its <strong>id</strong> which is <code>"green"</code>.</p><figure><img height="37" src="https://img-b.udemycdn.com/redactor/raw/2018-11-21_11-39-21-bc0da91118f1ff73e42a88f12e746ee8.png" width="588"></figure><p>3. At the top of the <strong>game.js</strong> file, create a new <strong>empty</strong> array with the name <code>userClickedPattern</code>.</p><p>4. Add the contents of the variable <code>userChosenColour</code> created in step 2 to the end of this new <code>userClickedPattern</code></p><p>At this stage, if you log the <code>userClickedPattern</code> you should be able to build up an array in the console by clicking on different buttons.</p><figure><img src="https://img-b.udemycdn.com/redactor/raw/2018-11-22_11-13-09-81cb08045950bf6a12182950a4d3f5f4.gif"></figure><p>Note: If you need any hints, try scrolling down. 👇</p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p><p>Hint 1A. Remember that all the buttons share the same class (<code>btn</code>).</p><p>Hint 1B. Remember that jQuery has a <code>.click()</code> function: <a href="https://api.jquery.com/click/" rel="noopener noreferrer" target="_blank">https://api.jquery.com/click/</a></p><p>Hint 1C. jQuery handlers are anonymous functions: <a href="https://api.jquery.com/click/#click-handler" rel="noopener noreferrer" target="_blank">https://api.jquery.com/click/#click-handler</a></p><p>Hint 2A. Inside the handler, you can use the keyword <strong>this</strong> to refer to the button object that triggered the click. </p><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this" rel="noopener noreferrer" target="_blank">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this</a></p><p>Hint 2B. You can use the<code> attr()</code> function in jQuery to find out the value of any of the attributes of an object. <a href="https://api.jquery.com/attr" rel="noopener noreferrer" target="_blank">https://api.jquery.com/attr</a></p>
Press p or to see the previous file or,
n or to see the next file
Comments
Integrate AWS S3
Use S3 remote
Select bucket
Access key
Finish
Use AWS S3 as storage!
Browsing data directories saved to S3 is possible with DAGsHub. Let's configure
your repository to easily display your data in the context of any commit!
Specify your S3 bucket
Select Region
af-south-1 - Africa (Cape Town)
ap-northeast-1 - Asia Pacific (Tokyo)
ap-northeast-2 - Asia Pacific (Seoul)
ap-south-1 - Asia Pacific (Mumbai)
ap-southeast-1 - Asia Pacific (Singapore)
ap-southeast-2 - Asia Pacific (Sydney)
ca-central-1 - Canada (Central)
eu-central-1 - EU (Frankfurt)
eu-north-1 - EU (Stockholm)
eu-west-1 - EU (Ireland)
eu-west-2 - EU (London)
eu-west-3 - EU (Paris)
sa-east-1 - South America (São Paulo)
us-east-1 - US East (N. Virginia)
us-east-2 - US East (Ohio)
us-gov-east-1 - US Gov East 1
us-gov-west-1 - US Gov West 1
us-west-1 - US West (N. California)
us-west-2 - US West (Oregon)
Congratulations!
The-Complete-Web-Development-Bootcamp is now integrated with AWS S3!
Delete Storage Key
Are you sure you want to delete this access key?
No
Yes
Integrate Google Cloud Storage
Use Google Storage
Select bucket
Upload key
Finish
Use Google Cloud Storage!
Browsing data directories saved to Google Cloud Storage is possible with DAGsHub. Let's configure
your repository to easily display your data in the context of any commit!
Specify your Google Storage bucket
Congratulations!
The-Complete-Web-Development-Bootcamp is now integrated with Google Cloud Storage!
Delete Storage Key
Are you sure you want to delete this access key?
No
Yes
Integrate Azure Cloud Storage
Use Azure Storage
Select bucket
Set key
Finish
Use Azure Cloud Storage!
Browsing data directories saved to Azure Cloud Storage is possible with DAGsHub. Let's configure
your repository to easily display your data in the context of any commit!
Specify your Azure Storage bucket
Congratulations!
The-Complete-Web-Development-Bootcamp is now integrated with Azure Cloud Storage!
Delete Storage Key
Are you sure you want to delete this access key?
No
Yes
Integrate S3 compatible storage
Use S3 like remote
Select bucket
Access key
Finish
Use any S3 compatible storage!
Browsing data directories saved to S3 compatible storage is possible with DAGsHub. Let's configure
your repository to easily display your data in the context of any commit!
Specify your S3 bucket
Bucket name cannot be the same as the repository name. Please change one of them.
Check this box only if you trust this domain, otherwise your data and credentials might be
stolen by man in the middle or spoofing attacks.
Congratulations!
The-Complete-Web-Development-Bootcamp is now integrated with your S3 compatible storage!