this vs $(this)

In jQuery functions, this most often refers to the actual DOM element you’re dealing with, whereas $(this) returns a jQuery object that wraps the element. In JavaScript, this always refers to the current scope. Many of jQuery’s functions will set that scope to be the element you’re working with. For instance The point is, that the jQuery object has all the … Read more

What is jQuery Unobtrusive Validation?

Brad Wilson has a couple great articles on unobtrusive validation and unobtrusive ajax.It is also shown very nicely in this Pluralsight video in the section on ” AJAX and JavaScript”. Basically, it is simply Javascript validation that doesn’t pollute your source code with its own validation code. This is done by making use of data- attributes in HTML.

jQuery change input type

You can’t do this with jQuery, it explicitly forbids it because IE doesn’t support it (check your console you’ll see an error. You have to remove the input and create a new one if that’s what you’re after, for example: You can give it a try here To be clear on the restriction, jQuery will not allow … Read more

Which selector do I need to select an option by its text?

This could help: Demo fiddle This would give you the option with text B and not the ones which has text that contains B. For recent versions of jQuery the above does not work. As commented by Quandary below, this is what works for jQuery 1.9.1: Updated fiddle