用于检查div是否被点击的php代码 [英] php code for checking whether a div is clicked or not
问题描述
like,
$ b $任何人都可以帮助我,我需要php代码来检查div是否被点击。 b
if(isset($ _ POST ['Submit1'])){}
但不是提交按钮,我需要一个div ...
任何人都可以帮助我请
谢谢 $ b $如果我正确地阅读你的问题,你将需要JavaScript,因为PHP不会访问DOM。我建议你将jQuery lib添加到页面中,因为向DIV添加单击事件更简单,否则必须在JavaScript中为DIV上的点击事件添加一个事件侦听器。
jQuery: http://api.jquery.com/click/
DIY: http:// www.codingforums.com/archive/index.php/t-122993.html
Can anyone help me .I need php code for checking whether a div is clicked or not.
like,
if (isset($_POST['Submit1'])) { }
But instead of submit button i need a div ... anyone help me please
thanks
You will need JavaScript for this as PHP doesn't access the DOM if I'm reading your question correctly. I would recommend you add jQuery lib to your page as it's simpler to add click event to a DIV, otherwise you have to add an event listener in javascript yourself for click events on the DIV.
jQuery: http://api.jquery.com/click/
DIY: http://www.codingforums.com/archive/index.php/t-122993.html
这篇关于用于检查div是否被点击的php代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!