开发者

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

开发者 https://www.devze.com 2023-03-24 01:40 出处:网络
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.

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

精彩评论

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