jQuery がなければ、次のようにします。
document.getElementsByName('content')[0].value;
ユーザーが入力した攪拌を正確に取得します。
編集
わかりました。別の要素の innerHTML として値を書き込んでいて、マークアップではなくリテラル テキストを表示したいのです。sans-jQuery の例を続けます。
<script>
// Set the text content of an element
var setText = (function() {
var d = document.createElement('div');
if (typeof d.textContent == 'string') {
d = null;
return function(el, text) {
el.textContent = text;
};
} else if (typeof d.innerText == 'string') {
d = null;
return function(el, text) {
el.innerText = text;
};
}
}());
</script>
<input name="content">
<button onclick="
setText(document.getElementById('d0'),
document.getElementsByName('content')[0].value);
">get value</button>
<div id="d0"></div>
またはSLaksが示唆するように(むしろ不可解に):
$('#d0').text($('[name=content]').val());
なぜ彼または彼女の答えになかったのかはわかりませんが。