如何添加一个可以在网页上给我一个结果的条件? [英] How to add a condition that can give me a result right on the web page?

查看:112
本文介绍了如何添加一个可以在网页上给我一个结果的条件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想挖出一个黑客工具......(尚未完成)..我应该编写哪些标记/脚本可以创建一种显示/显示不同内容的方式,即如果用户点击转移资源(通过选项)新行可能显示为......如输入您的姓名。我可以这样做吗?如果有人解决并提供代码,我将感激不尽:)。

这是我的代码:





选择做什么:
<选择>



< optgroup label =我想:><选项>生成资源< /选项>

< ;选项>减少资源< /选项>

<选项>传输资源< /选项>< / select>



< ; img src =spam.png> 更改
<输入值=从上面的图像中写出文字

type =textsize = 30选中>


< button>去< / button>




I just wanted to jest out a hack tool... (not completed yet).. and I what tag/script I should write that can create a way to show/appear different things, i.e. if a user clicks on "transfer resources" (through the option) a new line may appear as ... like "Enter your name". Can I do this? Please, I will be thankful if anyone solves and gives the code back :).
Here is my code:


Choose what to do:
<select>


<optgroup label="I want to:"><option>Generate Resources </option>
<option >Decrease Resources</option>
<option >Transfer Resources </option></select>


<img src= "spam.png">Change
<input value= "Write the text from image above"
type= "text" size= "30" checked>

<button > Go</button>






推荐答案

你需要学习javaScript和onchange()事件。



试试这个 JavaScript教程 [ ^ ]



您可能还应该查看HTML教程,了解如何为< options>提供值。 in< select> ;.



You need to study javaScript and the onchange() event.

Try this JavaScript Tutorial[^]

You probably should also look into the HTML tutorial as how one give values to <options> in <select>.


这篇关于如何添加一个可以在网页上给我一个结果的条件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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