Let’s learn about jquery. jquery is javascript library included in all meteor apps and used internally by meteor.

What is jQuery?

jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API

jquery

To get the example code, run: git clone https://github.com/RemyNoulin/jquery.git

The code demonstrates:

  • .html() to get or set html text for an element
  • .val() to get or set the value of an element
  • events click, dblclick and keyup
$('button').html('You clicked me, click me.');

The code above changes the text of the button.

$('input').val();
$('input').val('New text from code');

The code above gets and sets the value of the first input element.

var text = $(e.target).val();

The code above gets the value of the element targeted by the event.

$('#another_input').val()

The code above selects an element using an id.