Click a tag! The tag's text (value) will populate the search input.


Every time a keyword tag is clicked, the query.qt event is fired.

The event object passed to the handler after a query.qt event includes three custom properties:

event.tag returns the keyword tag text(.name).

event.form returns the form element with the .searchable class.

event.input returns the search input element located inside the .searchable form. The search input should be of type search or be assigned the #search id.

Example:
$(window).on("query.qt", function (e) {

    // set input value to clicked tag name
    e.input.val(e.tag);

    // submit the search query
    e.form.submit();

});

Form:
Input:

Tag:

Demo 4 : Search