JavaScript JS (edit)

JavaScript: Set

document.getElementById(id).attribute = new_value;
document.getElementById("Username").value = window.Username;
document.getElementById("Password").value = window.Password;
document.getElementById("RememberPassword").checked = window.RememberMe === 'True';

JavaScript: Checkbox

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox

jQuery (1.6+):

// Check
$("#checkbox").prop("checked", true);

// Uncheck
$("#checkbox").prop("checked", false);
<!DOCTYPE html>
<html>
<body>

Checkbox: <input type="checkbox" id="myCheck">

<button onclick="check()">Check Checkbox</button>
<button onclick="uncheck()">Uncheck Checkbox</button>

<script>
function check() {
document.getElementById("myCheck").checked = true;
}

function uncheck() {
document.getElementById("myCheck").checked = false;
}
</script>

</body>
</html>

JavaScript: Check null

element1 = document.getElementById(id);

if(element1 != null)
{
    //code to set the value variable.
}

References

Input Type: text, password, checkbox, radio, hidden, file, submit

Textarea

Select > Option

http://javascript-coder.com/html-form/html-form-tutorial-p1.phtml

http://javascript-coder.com/html-form/html-form-tutorial-p2.phtml