PHP:点击时替换文本的按钮 [英] PHP: replace a button with text when clicked

查看:131
本文介绍了PHP:点击时替换文本的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打一个按钮,点击后,显示在网站上简单的X,在相同的位置,按钮previously了。使按键会消失,并用×所取代。
我的按钮code是根本
<按钮的onclick =myFunction的()> 1 LT; /按钮>
我该怎么做呢?它必须是在PHP。

I want to make a button that, when clicked, displays a simple "X" on the site, in the exact same position that the button previously was. So the button will disappear, and be replaced with an "X". My button code is simply <button onclick="myFunction()">1</button> How do I do this? It has to be in PHP.

不能怪你们从,因为它可能是愚蠢至极downvoting这个问题,但我是新来的这门语言,我努力学习。未发现本网站上的任何类似的问题。

Can't blame you guys from downvoting this question since it's probably extremely stupid, but I'm new to this language and I'm trying to learn. Didn't find any similar questions on this site.

编辑:我发现别人的code这不正是我想要的,但我无法找出他们正在使用的过程中确切的行或code。 HTTP://www.javaist。 COM /博客/ 2013/04/29 /井字游戏,在PHP /评论页-1 /
他们是怎么做到的?

I found someone else's code that does exactly what I want to, but I can't pinpoint the exact line or code that they're using for the process. http://www.javaist.com/blog/2013/04/29/tictactoe-in-php/comment-page-1/ How do they do that?

推荐答案

在PHP是不可能的。 PHP是在服务器端执行的,如单击按钮相互作用(通常由客户端)在客户端上执行。你应该看看成JavaScript做这样的事情。

That's impossible in PHP. PHP is executed on the server side, interactions like clicking on a button are executed on the client side (usually by the client ). You should look into Javascript to do such things.

这篇关于PHP:点击时替换文本的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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