开发者

How to set the position of the text cursor inside a form field

When I click on the text box, I want the cursor to appear at the top left, and advance as you would advance down a word doc. Instead, it starts in the middle and pressing enter submits the string.

What I'm looking to do also is make it so pressing enter line breaks, rather than submits, and the cursor start at the top left of the page rather than the middle left.

<head>
<title>Notepad</title>
<link rel="stylesheet" type="text/css" href="../stylesheets/styles.css">
<script type= "text/ja开发者_开发知识库vascript" src="../javascripts/script.js"></script>
</head>

<body>
<form id="form1">
<input type="text" id="form2" value autofocus="on">
</form>
</body>

current form so far.


You should use a <textarea> instead of an <input type=text>.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜