在html表单字段中键入字符串值 [英] typing in string values in html form fields

查看:79
本文介绍了在html表单字段中键入字符串值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在尝试用HTML编写代码,如果需要可能会使用javascript。代码将打开一个网页并自动在字段中输入用户名和密码,然后单击提交按钮。

我希望处理的页面将光标放在第一个字段中。


所以我只需要在这些字段中键入字符串值。


请帮助我们如何继续。是不是可以单独使用HTML?


Thansk很多


Qi

解决方案

我怀疑这可以在没有javascript的情况下完成...你需要关注()你可以用简单的javascript做的字段。


亲切的问候

是。必须使用Javascript。


非常感谢您的答案


任何人都可以指导我如何在javascript中完成它。


我知道javascript初学者级别。正如我在帖子中所说,当网页打开时,光标已经在正确的字段中。现在如何键入该字段中的内容。我应该使用什么JavaScript方法?


另外,为了以防万一,将焦点带到另一个字段的功能是什么,它只是焦点()?


谢谢

Qi


Hi

I am trying to write a code in HTML , maybe will use javascript if required. The code will open a webpage and type in username and password in the fields automatically and click the submit button.

The page i wish to work on put the cursor in the first field by default.

So i just need to type in the string values into these fields.

Please help as to how to proceed. Is it possible to do it in HTML alone?

Thansk a lot

Qi

解决方案

i doubt that this could be done without javascript ... you need to focus() the fields what you could do with simple javascript.

kind regards


Yes. Javascript must be used.


Thanks a lot for answers

Could anyone direct me how to do it in javascript.

I know javascript to beginners level. As i said in my post, when the webpage opens, the cursor is in the right field already. Now how to type in something in that field. What javascript method shall i use?

Also, just in case, whats the function to bring focus onto a different field, is it just focus() ?

Thanks
Qi


这篇关于在html表单字段中键入字符串值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆