Edit in JSFiddle

<html>
<body>

<div id="some-id">div#some-id</div>
<div class="some-class">
	div.some-class
	<div class="some2-class">
	div.some-class.some2-class
	</div>
</div>
<form name="form1">
	<p>form[name=form1] > p</p>
	<input type="text" name="text1">
	<input type="password" name="pass1">
</form>

<script>
var el1 = document.getElementById("some-id");
el1.textContent = "Text 1";

var el2 = el1.nextElementSibling;
el2.childNodes[0].nodeValue = "Text 2";
// el2.textContent = "Text 2"; ???

el2.children[0].textContent = "Text 3";

document.form1.firstElementChild.textContent = "Text 4";
document.forms[0].text1.value = "text1 value...";

document.querySelector("form[name=form1] > input[type=password]").value = "pass1 value..";
</script>

</body>
</html>