当前位置:网站首页>Educoder Web练习题---创建文本区域
Educoder Web练习题---创建文本区域
2022-06-21 12:22:00 【是小鹿啊】
创建文本区域
文章目录
第1关:textarea控件相关概念
相关知识
textarea标签的属性
textarea标签用于定义多行文本区域,文本区域中可容纳无限数量的文本,其中文本的默认字体是等宽字体(Courier)。
textarea的基本属性
textarea的基本属性主要有:
- cols:规定每行中的字符数
- rows:规定可见的行数
- name:规定文本区域的名称
- readonly:规定文本区域为只读
- disabled:规定文本区域为不可用
HTML5中textarea的新属性
textarea的新属性主要有:
- wrap:规定表单提交时,文本区域的文本换行模式。取值为soft表示不换行,取值为hard表示换行
- maxlength:规定文本区域的最大字符数
- placeholder:规定一个简短的提示,描述文本区域期望的输入值
- required:规定文本区域是必需的/必填的。
- autofocus:规定当页面加载时,文本区域自动获得焦点
- form:定义文本区域所属的一个或多个表单。
通关知识
1、若将文本区域设置为显示10行,每行显示50个字符,正确选项是(C)
A、<textarea rows="50" cols="10">
B、<input rows="50" cols="10">
C、<textarea rows="10" cols="50">
D、<input rows="10" cols="50">
2、若将文本区域设置为只读的,可在textarea标签中添加(B)属性。
A、disabled
B、readonly
C、required
D、autofocus
3、在表单提交时使textarea 中的文本换行,正确的选项是(D)
A、<textarea name="mm" rows="5" cols="50">
B、<textarea name="mm" rows="5" cols="50" wrap>
C、<textarea name="mm" rows="5" cols="50" wrap="soft">
D、<textarea name="mm" rows="5" cols="50" wrap="hard">
4、textarea标签的属性不包括(A)
A、width
B、rows
C、cols
D、maxlength
5、textarea文本区域的宽度可用size属性来设置。(B)
A、正确
B、错误
第2关:创建文本域
相关知识
文本域的设置
在textarea标签中,使用cols属性来规定文本域中每行的字符数,使用cols属性来规定文本域中每行的字符数,使用rows属性可规定文本域中可见的行数,使用name属性可规定文本域的名称,使用wrap属性可规定表单提交时,文本区域的文本换行模式。添加required属性可规定文本域的内容必填写。
示例如下:
推荐理由:<textarea name="userName" cols="40" rows="4" wrap="hard" required="required"></textarea>
效果如下:

编程要求
请在右侧编辑器中的Begin - End区域内补充代码,具体要求是:
- 创建一个文本域
- 文本域的名称为“reason"
- 文本域中可见行数为为6,每行50个字符
- 文本域内容必须填写
- 表单提交时,文本显示区中的文本在行尾要自动换行
效果如下:

通关代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>设置文本域</title>
</head>
<body>
<form action="" method="post">
请输入你选择本专业的理由:<br/>
<!-- ********* Begin ********* -->
<textarea name="reason" cols="50" rows="6" required="required" wrap="hard"></textarea>
<!-- ********* End ********* -->
<br/>
<input type="reset" value="重置">
<input type="submit" value="提交">
</body>
</html>
边栏推荐
- Ansible operating instructions for configuring SSH authentication free for the first time
- 关于SDRAM存储器
- Generalized Focal Loss: Learning Qualified and Distributed Bounding Boxes for Dense Object Detection
- 动手学数据分析 数据重构
- Corrigendum to 138 sets of reference solutions to the real problems of Higher Algebra in 2022
- 2. 引用
- The difference between knowing and understanding
- [cloud native | Devops] Jenkins installation and actual combat (II)
- Artifacial Intelligent Project
- 五大(七大)原则-系统学习三
猜你喜欢

i.MX - RT1052时钟及锁相环(PLL)分析

The final battle of the giant: instant retailing

These three young men are more ruthless than Ma Huateng and Zhang Yiming

WPF uses Maui's self drawing logic

蜜雪冰城(已黑化)

External attention tensorflow (under update)

Hands on data analysis data reconstruction

Vs code + GCC environment compilation for STM32 development

A recovery solution of system paralysis caused by upgrading glibc of VMware virtual machine

PWM (pulse width modulation) of STM32 notes
随机推荐
Vs code + GCC environment compilation for STM32 development
i.MX - RT1052 脉宽调制(PWM)
Architect training plan - infinite thinking - variables
SSD的anchor_box计算
嵌入struct和嵌入interface
i. MX - rt1052 input / output (GPIO)
Hands on data analysis data reconstruction
1.内存分区模型
Redis-bitmap 位图
Schéma technique du système de surveillance de l'environnement de la salle de distribution
[100 unity pit knowledge points] | unity controls the object to continuously point in a certain direction
uniapp中常用到的方法(部分) - 时间戳问题及富文本解析图片问题
I would like to ask you guys, the flick CDC will add a table level exclusive lock before extracting the full amount of Oracle data
CPU、MPU、MCU、SoC、MCM介绍
dicom格式转成nii.gz文件
PHP使用Grafika合成图片,生成海报图
路由器Telnet及ACL配置
Version number naming convention
3. 函数提高
~~~~配置