Hi all, just a quick question. I believed that $('#value') was a jQuery function equivalent to document.getElementById('value') however, in the code below, only the second function gives the desired result.

Can someone explain why this is?

        $('#value').value = "1";
        document.getElementById("value").value = "1";

Just so you know:

$('#value') // jquery object
//set value as
$('#value').val(1);

$('#value')[0] // DOM object
// so you can also set the value as
$('#value')[0].value = "1"; // This is not recommended, it's just to show that jQuery objects relay on the DOM object itself