Working Ninja
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-10-14T08:12:31
$('#id').on('input', fuction(){
    var dInput = this.value;
    $('#output').text(dInput);
});

READ MORE

2014-11-03T17:55:25

There are times that you want to hide mobile specific features on desktop to avoid user confusion. Today I ran into such a case where a tel href on a phone number was being used that resulted in someone getting a 404. To hide this from desktop, I used jQuery …

READ MORE