Skip to content

Instantly share code, notes, and snippets.

@dergachev
Last active December 14, 2015 13:18
Show Gist options
  • Save dergachev/5092457 to your computer and use it in GitHub Desktop.
Save dergachev/5092457 to your computer and use it in GitHub Desktop.
Impromptu jQuery tutorial - Ottowa Feb 28, 2013

Slide decks:

Tutorials:

jQuery snippets to run in the console

Replaces images with conservative.ca logo:

jQuery('img')
  .attr('src','http://www.conservative.ca/wp-content/themes/conservative/images/featureMenu-navMenu-Conservative-en.png')

Remove all li tags (list-item):

jQuery('li').remove();

Without jQuery, get the element with id="logo" and (assuming it's a link) make it pont to drupal.org:

logo = document.getElementById('logo');
logo.href='http://drupal.org';
console.log(logo.href);

Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment