Code sample that will help you jump start JQuery. Read the previous post here.
//Basic Filter $(".comment-single > .comment- body").filter(":odd") .filter("<wbr />:first").text() //text value inside is displayed $(".comment-single > .comment-body") .filter(":<wbr />contains(great)") $(".comment-single > .comment- body").filter(":odd") .filter("<wbr />:not(:contains(great))") $("p code:first-child") $("p code:first-child") .css("text-<wbr />decoration", "underline") $("p code:first-child") .css("<wbr />background-color", "yellow"); $(".comment.even") .css("background-<wbr />color", "red"); //in order to select a multiple class assigned to a single div then use period (.) Animation $(".comment.even").hide(1000) $(".comment.even").show(1000) $(".comment.even").toggle(2000) $(".comment.even").fadeOut() $(".comment.even").fadeIn() $(".comment.even").slideUp() $(".comment.even").slideDown() DOM activity $(".comment.even").append("hello"); $('<p>This is really cool way of learning</ p>') .appendTo('.comment.even'); $(".comment.even") .prepend("test value"); $('<p>This is really cool way of learning</ p>') .prependTo('.comment.even'); $(".comment.even") .before("test value me up"); $(".comment.even") .after("test value me up");
All the best for learning JQuery.
1 comment