手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

js如何设置两个input之间的距离

时间:2024-10-12 02:40:45

1、新建一个html文件,命名为test.html,用于讲解js如何设置两个input之间的距离。

js如何设置两个input之间的距离

2、在test.html文件内,使用input标签创建两个文本框,用于测试。

js如何设置两个input之间的距离

3、在test.html文件内,设置其中一个input标签的id属性为sone。

js如何设置两个input之间的距离

4、在test.html文件内,创建script标签,用于编写js代码。

js如何设置两个input之间的距离

5、在js标签内,通过id获得input对象,利用marginTop属性设置两个input之间的距离为50px。

js如何设置两个input之间的距离

6、在浏览器打开test.html文件,查看结果。

js如何设置两个input之间的距离
© 手抄报圈