All In One Script
MENU

by 5:06:00 AM
undefined
<button> vs. <input type=“button” />. Which to use? When looking at most sites (including SO), most of them use: <input type="button" /> instead of: <button></button> What are the main differences between the two, if any? Are there valid reasons to use one instead of the other? Are there valid reasons to use combine them? Does using <button> come with compatibility issues, seeing it is not very widely used? answer: Here's a page describing the differences (basically you can put html into a <button></button>) And an other page describing

Disable/enable an input with jQuery?

by 5:21:00 AM
undefined
Disable/enable an input with jQuery? $input.disabled = true; or $input.disabled = "disabled"; Which is the standard way? And, conversely, how do you enable a disabled input? Answer: jQuery 1.6+ To change the disabled property you should use the .prop() function. $("input").prop('disabled', true); $("input").prop('disabled', false); jQuery 1.5 and below The .prop() function doesn't exist, but .attr() does similar: Set the disabled attribute. $("input").attr('disabled','disabled'); To enable again, the proper method is to use .removeAttr() $("input").removeAttr('disabled'); In any version of jQuery You can always rely on the actual DOM object and is probably a little faster

Instagram