HTML
+c.P.u1 jQuery solution can be written in standard JS for modern browsers (IE >=9) as follows
function label (el) {
(el = document.querySelector ('label[for=" + el.id + '"]')) &&
(el.style.display = 'none');
}
Note that we need to pass the input
element as a parameter to the label function.
The fiddle at http://jsfiddle.net/jstoolsmith/v5kZb/ shows a more structured way of doing this and also replaces the label when the input element loses focus.