Hi
I tried to write a piece of code that gets a piece of text that was copied into a textfield, splits it and returns the first line of it into another textfield.
Can you tell me what’s wrong with what I wrote?
[CODE]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<meta http-equiv=”Content-Style-Type” content=”text/css”>
<meta http-equiv=”Content-Script-Type” content=”text/javascript”>
<script type=”text/javascript”>
function getTitle()
{
var form= document.getElementById(‘titleForm’);
var article= document.getelementById(‘articleField’).value;
var title= article.split(“n”)
inp=document.createElement(‘input’);
inp.type=’text’;
inp.name=’titleField’;
inp.id=’titleField’;
inp.value=title[0];
form.appendChild(inp);
}
</script>
</head>
<body>
<form id=”titleForm” action=””>
<input type=”text” name=”articleField” id=”articleField”/>
<INPUT TYPE=”button” NAME=”button” Value=”Click” onClick=”getTitle()”>
</form>
</body>
</html>