Which is faster: $("#element")[0].value or $("#element").val() ? If the former is faster, what is the purpose of the latter?
$("#element")[0].value
$("#element").val()
$("#element")[0].value faster, native code is always faster.
document.getElementById("element").value will be even faster.
document.getElementById("element").value
The .val() function should work for all input types, including the <textarea> and <select> elements. Under all of this, not <option> or a <select> or a <input type="radio"> (in some cases) receives .value .
.val()
<textarea>
<select>
<option>
<input type="radio">
.value
matches $("#element") slower than document.getElementById('element');
$("#element")
document.getElementById('element');
ease of use, consistency in structure, hiding cross-browser implementation (inconsistencies, not a concrete example, but this is the concept of frameworks).