Email:   Password:
Blog :: Technical Learning by Thomas Riemer
RSS 2.0   RSS 1.0   Atom
jquery   (PDF)
Posted February 22nd, 2024

jquery is a javascript library that simplifies DOM management.
Basic Jquery Cheatsheet:

Get it from:
https://jquery.com/download

Run on Load
<script>
$(document).ready(function() {
});
</script>

Reference a type (e.g. a button)
$("typename").addClass("foo");

Reference a class:
$(".classname").addClass("foo");

Reference an id:
$("#idname").addClass("foo");

Functions:
----------
css - add css rule to element
   Sample $(#myid).css('background-color','red');
   Note that its a comma between elements, not a colon
addClass - adds a class to an element
removeClass -removes a class from an element
html - sets body of element
text - set element text without evaluating
remove - removes an element
appendTo - appends selected element to new target
      Sample: $("#myid").appendTo("#target2");
clone - create a clone
     Sample: $("#myid").clone().appendTo("#target2");
parent - finds parent element of element selected.
children - finds children elements of element selected.
nth-child - finds nth child of element



Copyright © 2024 Mind Contract, Inc.   All Rights Reserved
For more information call thomasriemer49@gmail.com or email 720-883-1866
Powered By: Build a Member