-
Notifications
You must be signed in to change notification settings - Fork 2
JQuery
Now that we have a basic understanding of html and css (from the last educational) and now JavaScript we can add JQuery, a JavaScript library designed to simplify the HTML client-side scripting. Its syntax makes its easier to navigate a document, create animations and handle events among other features.
Events can be handled using JQuery Event Methods. Events are actions or occurrences recognized by the program, which can then be handled by the program. An example of an event is when the user clicks a button on the screen, and event handler is the part of the code that will react to this action.
Event methods in JQuery trigger or attach a function to an event handler for the selected elements.
List of Useful Methods:
$(selector).action ()
$ accesses JQuery
(selector) used to find HTML elements
.action() applies action to the elements
$(document).ready(function()
prevents any code from running before document has loaded
.html used to set or return html content
$(selector).html(content) sets content to the element chosen
.on attatches event handlers to elements
.removeClass gets rid of a class
.attr get the value of an attribute
.css sets or returns one or more style properties
######Math Object
Math.floor() rounds a number down to the nearest integer
Math.random() returns a random number between 0 and 1