//Selecting
$("selectorGoesHere") 

//Get the value of property
$(selector).css(property) 
//Manipulating Style with property-value pair
$(selector).css(property, value) 
//Manipulating Style with a object
$(selector).css(styles) 

//Get the text
$(selector).text() 
//Set the text
$(selector).text(text) 

//Get the html
$(selector).html() 
//Set the html
$(selector).html(html) 

//Get the attribute's value
$(selector).attr(attr) 
//Set the value to one attribute
$(selector).attr(attr, value) 

//Get the value ( for input, checkbox, etc)
$(selector).val() 
//Set the value
$(selector).val(val) 

//Manipulating Style with a class
$(selector).addClass(class) 
$(selector).removeClass(class)
$(selector).toggleClass(class)

//Click event
$(selector).click(function)

//Keypress event
$(selector).keypress(function)
$(selector).keypress(function(event){
    if(event.which == 13){
        alert("enter");
    }
}

//On event: On() will add listeners for all potential future elements
$(selector).on("click", function)

//Fadeout in time and do function after that
$(selector).fadeOut(time, function);

Leave a Reply

Your email address will not be published. Required fields are marked *