jobo: textbox - text einfügen

Beitrag lesen

Hallo,

value gibts auch als eigenschaft:

<html>  
<html>  
<head>  
<script type="text/javascript">  
function texteinfugen(welcher)  
{  
document.getElementById("txtar").innerHTML=document.getElementById("txtar").innerHTML+welcher;  
}  
function show_innerhtml() {  
	alert(document.getElementById("txtar").innerHTML);  
}  
function show_value() {  
	alert(document.getElementById("txtar").value);  
}  
function set_value(some_text) {  
	document.getElementById("txtar").value=document.getElementById("txtar").value + some_text;  
}  
</script>  
</head>  
<body>  
<textarea id="txtar">aaa</textarea>  
<a href="javascript:texteinfugen('test')">test einfügen</a>  
<a onclick="show_innerhtml()">show innerhtml</a>  
<a onclick="show_value()">show value</a>  
<a onclick="set_value('neuer_wert')">set value</a>  
</body>  
</html>  

Gruß

jobo