Working Ninja
2018-05-03T17:26:20

Toggle all <option>'s as checked/unchecked with the click of a <button>.

<select>
    <option></option>
    <option></option>
    <option></option>
</select>

<button></button>
jQuery("button").click(function(){
    jQuery("select :checkbox").each(function(){
        this.checked = !this.checked;
    });
});

Source: https://stackoverflow.com/questions/4177159/toggle-checkboxes-on-off

READ MORE

2017-07-19T10:46:37

Let's say you add an element to the DOM via jQuery:

$("<button class="delete">Delete</button>").appendTo("foo");

And want to later remove it via a jQuery event. Calling $('.delete').on('click') will not fire the event. This is because .on() only looks for elements that were loaded initially with the DOM. To resolve you can use …

READ MORE

2015-11-20T09:04:44
$( document ).ready(function() { });

is jQuery for:

document.addEventListener("DOMContentLoaded", function(event) { }); 

READ MORE

2015-10-14T08:12:31
$('#id').on('input', fuction(){
    var dInput = this.value;
    $('#output').text(dInput);
});

READ MORE