Date din camp formular adaugate in DIV
Scris: Dum Dec 09, 2012
Am o problema banala dar nu inteleg de ce nu merge. Am un formular din care incerc sa preiau datele introduse intr-un camp textarea si sa le pun intr-un DIV, dar totul merge aiurea si nu inteleg de ce.
Cod: Selectaţi tot
<html>
<head>
<title>titlu</title>
<script type="text/javascript">
function afiseaza(){
elm='';
var text1='';
text1=document.enunturi.enunt.value;
elm=document.getElementById('listaEnunturi');
elm.innerHTML+=text1;
}
</script>
</head>
<body>
<form name="enunturi">
<input type="text" value="" name="enunt">
<br/>
<input type="submit" value="afiseaza enunt" onclick="afiseaza();">
</form>
<div id="listaEnunturi" style="border:2px solid red;width:200px;">
</div>
</body>
</html>