简体   繁体   English

如何编写这样的onclick代码以使我能够进行分析?

[英]How do I write such an onclick code which enable me to analyse?

I created a website. 我创建了一个网站。 There are questions which show up in order. 有一些问题按顺序显示。 When you click an answer, the next question is coming. 当您单击一个答案时,下一个问题来了。 There is no problem thus far. 到目前为止没有问题。 But I also want to comment every answer. 但我也想评论每个答案。 For example if the user click option one as the answer of first question, this will trigger a comment such "you chose option one, it means you are...". 例如,如果用户单击选项一作为第一个问题的答案,则将触发注释,例如“您选择了选项一,表示您...”。 But the problem is I want to show comments altogether after the last question. 但是问题是我想在最后一个问题之后完全显示评论。 Is there any way to make it possible? 有什么办法可以实现? ( by the way I am not an coder, I just have a project which I have to done; so maybe it is such a dead easy question. Sorry about that.) (顺便说一句,我不是编码人员,我只是有一个我必须完成的项目;所以也许这是一个非常简单的问题。很抱歉。)

I am not sure, if i understood your question correctly. 我不确定我是否正确理解了您的问题。

Maintain one array of size equals to number of questions. 保持一个数组大小等于问题数量。 when you click on for next question save first question comment as in the first array position and so on... At the last question you probably provide submit button, on the you read complete array data and display it. 当您单击下一个问题时,将第一个问题注释保存为第一个数组的位置,依此类推...在最后一个问题中,您可能会提供“提交”按钮,在该按钮上您可以读取完整的数组数据并显示它。

除了注释,您可以使用.onclick函数填写字符串变量中的写入内容,然后在事情的末尾打印出来

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM